<!DOCTYPE html>
<html><head><meta charset="UTF-8"><meta content="width=device-width, initial-scale=1" name="viewport"><meta content="Integration, differentiation (finite difference), solvers and Richardson extrapolation." property="og:description"><meta content="Calculus" property="og:title"><meta content="article:clerk" property="og:type"><meta content="summary_large_image" name="twitter:card"><script src="https://cdn.tailwindcss.com?plugins=typography" type="text/javascript"></script><script>tailwind.config = {
  darkMode: "class",
  content: ["./tw/viewer.js", "./tw/**/*.edn"],
  safelist: ['dark'],
  theme: {
    extend: {},
    fontFamily: {
      sans: ["Fira Sans", "-apple-system", "BlinkMacSystemFont", "sans-serif"],
      serif: ["PT Serif", "serif"],
      mono: ["Fira Mono", "monospace"]
    }
  },
  variants: {
    extend: {},
  },
  plugins: [],
}
</script><style type="text/tailwindcss">@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  html {
    font-size: 18px;
  }
  @media (max-width: 600px) {
    html {
      font-size: 16px;
    }
  }
  .font-condensed { font-family: "Fira Sans Condensed", sans-serif; }
  .font-inter     { font-family: "Inter", sans-serif; }
  body {
    @apply font-serif antialiased text-gray-900 sm:overscroll-y-none;
  }
  code, .code {
    @apply font-mono text-sm text-gray-900 bg-slate-50 px-0.5 py-px rounded dark:bg-gray-800;
  }
  code::before, code::after { @apply content-none !important; }
  h1, h3, h4, h5, h6 {
    @apply font-condensed font-bold mt-8 first:mt-0;
  }
  h2 {
    /*We cannot collapse margins due to nesting but we want to*/
    /*keep the h2’s large margin visible*/
    @apply font-condensed font-bold mt-8 first:mt-2;
  }
  h1 { @apply text-4xl; }
  h2 { @apply text-3xl; }
  h3 { @apply text-2xl; }

  @media print {
      h1 { @apply text-2xl !important; }
      h2 { @apply text-xl !important; }
      h3 { @apply text-lg !important; }
  }

  button { @apply focus:outline-none; }
  strong { @apply font-bold; }
  em     { @apply italic; }
  pre    { @apply m-0 font-mono; }
  table img { @apply inline-block; }
}

/* Compatibility */
/* --------------------------------------------------------------- */
/* TODO: Verify which colors are in use and replace with Tailwind
   colors accordingly. Move Nj-specific styles out of here. */

:root {
  --teal-color: #31afd0;
  --dark-teal-color: #095960;
  --near-black-color: #2e2e2c;
  --red-color: #d64242;
  --dark-blue-color: #1f2937;
  --dark-blue-60-color: rgba(28, 42, 56, 0.6);
  --gray-panel-color: rgba(239, 241, 245, 1.000);
  --brand-color: var(--dark-blue-color);
  --link-color: #5046e4;
  --command-bar-selected-color: var(--teal-color);
}

.serif      { @apply font-serif; }
.sans-serif { @apply font-sans; }
.monospace  { @apply font-mono; }
.inter      { @apply font-inter; }

.border-color-teal { border-color: var(--dark-teal-color); }
.teal { color: var(--teal-color); }
.bg-dark-blue { background: var(--dark-blue-color); }
.bg-dark-blue-60 { background: rgba(28, 42, 56, 0.6); }
.bg-gray-panel { background: var(--gray-panel-color); }
.text-dark-blue  { color: var(--dark-blue-color); }
.text-dark-blue-60 { color: var(--dark-blue-60-color); }
.border-dark-blue-30 { border-color: rgba(28, 42, 56, 0.6); }
.text-brand { color: var(--dark-blue-color); }
.bg-brand { background: var(--dark-blue-color); }
.text-selected { color: white; }
.red { color: var(--red-color); }

/* Disclose Button */
/* --------------------------------------------------------------- */

.disclose {
  @apply content-none border-solid cursor-pointer inline-block relative mr-[3px] top-[-2px] transition-all;
  border-color: var(--near-black-color) transparent;
  border-width: 6px 4px 0;
}
.disclose:hover {
  border-color: var(--near-black-color) transparent;
}
.dark .disclose,
.dark .disclose:hover {
  border-color: white transparent;
}
.disclose.collapsed {
  @apply rotate-[-90deg];
}

/* Layout */
/* --------------------------------------------------------------- */

.page {
  @apply max-w-5xl mx-auto px-12 box-border flex-shrink-0;
}
.max-w-prose { @apply max-w-[46rem] !important; }
.max-w-wide  { @apply max-w-3xl !important; }

/* List Styles */
/* --------------------------------------------------------------- */

.task-list-item + .task-list-item,
.markdown-viewer ul ul {
  @apply mt-1 mb-0;
}

/* compact TOC */
.markdown-viewer .toc ul {
  list-style: none;
  @apply my-1;
}

/* Code Viewer */
/* --------------------------------------------------------------- */

.code-viewer {
  @apply font-mono bg-slate-100 rounded-sm text-sm overflow-x-auto dark:bg-gray-800;
}
.code-listing  {
    @apply -ml-8 -mr-8 relative !important;
}
.code-viewer .cm-content {
  @apply py-4 px-8;
}
@media (min-width: 960px){
    .notebook-viewer .code-viewer .cm-content {
        @apply pl-12;
    }
    .notebook-viewer .code-listing {
        width: 48rem !important;
        @apply -ml-12 mr-0 !important;
    }
}
/* Don’t show focus outline when double-clicking cell in Safari */
.cm-scroller { @apply focus:outline-none; }

/* Syntax Highlighting */
/* --------------------------------------------------------------- */

.inspected-value { @apply text-xs font-mono leading-[1.25rem]; }
.cmt-strong, .cmt-heading { @apply font-bold; }
.cmt-italic, .cmt-emphasis { @apply italic; }
.cmt-strikethrough { @apply line-through; }
.cmt-link { @apply underline; }
.untyped-value { @apply whitespace-nowrap; }

.cm-editor, .cmt-default, .result-viewer {
  @apply text-slate-800 dark:text-slate-300;
}
.cmt-keyword {
  @apply text-purple-800 dark:text-pink-400;
}
.cmt-atom, .cmt-bool, .cmt-url, .cmt-contentSeparator, .cmt-labelName {
  @apply text-blue-900 dark:text-blue-300;
}
.cmt-inserted, .cmt-literal {
  @apply text-emerald-700 dark:text-emerald-200;
}
.cmt-string, .cmt-deleted {
  @apply text-rose-700 dark:text-sky-300;
}
.cmt-italic.cmt-string {
  @apply dark:text-sky-200;
}
.cmt-regexp, .cmt-escape {
  @apply text-orange-500 dark:text-orange-300;
}
.cmt-variableName {
  @apply text-blue-800 dark:text-sky-300;
}
.cmt-typeName, .cmt-namespace {
  @apply text-emerald-600 dark:text-emerald-300;
}
.cmt-className {
  @apply text-teal-600 dark:text-teal-200;
}
.cmt-macroName {
  @apply text-teal-700 dark:text-teal-200;
}
.cmt-propertyName {
  @apply text-blue-700 dark:text-blue-200;
}
.cmt-comment {
  @apply text-slate-500 dark:text-slate-400;
}
.cmt-meta {
  @apply text-slate-600 dark:text-slate-400;
}
.cmt-invalid {
  @apply text-red-500 dark:text-red-300;
}

.result-data {
  @apply font-mono text-sm overflow-x-auto whitespace-nowrap leading-normal;
}
.result-data::-webkit-scrollbar, .path-nav::-webkit-scrollbar {
  @apply h-0;
}
.result-data-collapsed {
  @apply whitespace-nowrap;
}
.result-data-field {
  @apply ml-4 whitespace-nowrap;
}
.result-data-field-link{
  @apply ml-4 whitespace-nowrap cursor-pointer;
}
.result-data-field-link:hover {
  @apply text-black bg-black/5;
}
.result-text-empty {
  color: rgba(0,0,0,.3);
}
.browsify-button:hover {
  box-shadow: -2px 0 0 2px #edf2f7;
}

/* Prose */
/* --------------------------------------------------------------- */

.notebook-viewer,
.markdown-viewer {
  @apply prose
    dark:prose-invert
    prose-a:text-blue-600 prose-a:no-underline hover:prose-a:underline
    dark:prose-a:text-blue-300
    prose-p:mt-4 prose-p:leading-snug
    prose-ol:mt-4 prose-ol:mb-6 prose-ol:leading-snug
    prose-ul:mt-4 prose-ul:mb-6 prose-ul:leading-snug
    prose-blockquote:mt-4 prose-blockquote:leading-snug
    prose-hr:mt-6 prose-hr:border-t-2 prose-hr:border-solid prose-hr:border-slate-200
    prose-figure:mt-4
    prose-figcaption:mt-2 prose-figcaption:text-xs
    prose-headings:mb-4
    prose-table:mt-0
    prose-th:mb-0
    prose-img:my-0
    prose-code:font-medium prose-code:bg-slate-100
    max-w-none;
}
.markdown-viewer blockquote p:first-of-type:before,
.markdown-viewer blockquote p:last-of-type:after {
  @apply content-none;
}
.markdown-node-viewer.result-viewer.fragment-item {
    @apply mb-0 !important;
}

/* Images */
/* --------------------------------------------------------------- */


/* Todo Lists */
/* --------------------------------------------------------------- */

.contains-task-list {
  @apply pl-6 list-none;
}
.contains-task-list input[type="checkbox"] {
  @apply appearance-none h-4 w-4 rounded border border-slate-200 relative mr-[0.3rem] ml-[-1.5rem] top-[0.15rem];
}
.contains-task-list input[type="checkbox"]:checked {
  @apply border-indigo-600 bg-indigo-600 bg-no-repeat bg-contain;
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
}

/* Markdown TOC */
/* --------------------------------------------------------------- */

.markdown-viewer .toc      { @apply mt-4; }
.markdown-viewer h1 + .toc { @apply mt-8; }

.markdown-viewer .toc h1,
.markdown-viewer .toc h2,
.markdown-viewer .toc h3,
.markdown-viewer .toc h4,
.markdown-viewer .toc h5,
.markdown-viewer .toc h6 {
  @apply text-base text-indigo-600 font-sans my-0;
}
.markdown-viewer .toc a {
  @apply text-indigo-600 font-normal no-underline hover:underline;
}
.markdown-viewer .toc li    { @apply m-0; }
.markdown-viewer .toc ul ul { @apply pl-4; }

/* Notebook Spacing */
/* --------------------------------------------------------------- */

.markdown-viewer *:first-child:not(.code-viewer):not(li):not(h2):not(.sidenote) { @apply mt-0; }
/*.viewer + .viewer { @apply mt-6; }*/
.viewer + .result-viewer { @apply mt-0; }
.code-viewer + .result-viewer { @apply mt-3; }
.markdown-viewer + .markdown-viewer { @apply mt-0; }

/* Sidenotes */
/* --------------------------------------------------------------- */

.sidenote-ref {
  @apply top-[-0.5em] w-auto h-auto inline border-0 bg-transparent m-0 pointer-events-none;
}
.sidenote {
  @apply block font-sans text-xs mt-4 bg-slate-100 dark:bg-slate-800 p-4;
  font-style: normal;
  font-weight: normal;
}
.sidenote-container {
  @apply mb-4;
}
@media (min-width: 860px) {
  .sidenote sup { @apply inline; }
  .sidenote-column {
    @apply w-[165px] absolute right-0 top-0 -mr-[205px];
  }
  .sidenote {
    @apply bg-transparent dark:bg-transparent p-0;
  }
  .sidenote:first-child {
    @apply mt-1;
  }
  .sidenotes-layout .markdown-viewer {
    @apply pr-[241px];
  }
  .sidenote-container {
    @apply relative mb-0;
  }
  .sidenotes-layout h1 {
    @apply w-[756px] !important;
  }
}
.code-viewer + .viewer:not(.code-viewer):not(.code-viewer-folded),
.code-viewer-folded + .viewer:not(.code-viewer):not(.code-viewer-folded),
.result-viewer:not(.markdown-node-viewer) + .result-viewer {
  @apply mt-2;
}
.code-viewer + .code-viewer-folded {
  @apply mt-4;
}
.result-viewer {
  @apply leading-tight mb-6;
}
.code-viewer.fragment-item.result-viewer {
  @apply mb-0 !important;
}
.result-viewer figure {
  @apply mt-0 !important;
}
@media (min-width: 768px) {
  .devcard-desc > div {
    @apply max-w-full m-0;
  }
}

/* Command Palette */
/* --------------------------------------------------------------- */

.nj-commands-input {
  @apply bg-transparent text-white;
}
.nj-context-menu-item:hover:not([disabled]) {
  @apply cursor-pointer;
  background-color: rgba(255,255,255,.14);
}

/* Devdocs */
/* --------------------------------------------------------------- */

.logo, .logo-white {
  @apply block indent-[-999em];
  background: url(/images/nextjournal-logo.svg) center center no-repeat;
}
.devdocs-body {
  @apply font-inter;
}

/* Workarounds */
/* --------------------------------------------------------------- */

/* Fixes vega viewer resizing into infinity */
.vega-embed .chart-wrapper { @apply h-auto !important; }
/* fixes fraction separators being overridden by tw’s border-color */
.katex * { @apply border-black; }

@media print {
    .dark-mode-toggle,
    .toc-toggle { @apply hidden; }
    .notebook-viewer { @apply pt-0; font-size: 12pt !important; margin-left: 0 !important; }
    .code-viewer .cm-content,
    .viewer-code .cm-content { @apply whitespace-pre-wrap !important; overflow: none; }
    .code-viewer .cm-line { font-size: 12pt !important; }
    html * { page-break-inside: avoid !important; }
    .toc-panel { @apply hidden; }
}
</style><script src="https://storage.clerk.garden/nextjournal/clerk-assets@3mwzShgnuyfhgFN9ahRYKqV32K11/viewer.js?immutable=true" type="module"></script><link href="https://cdn.jsdelivr.net/npm/katex@0.13.13/dist/katex.min.css" rel="stylesheet" type="text/css"><link href="https://fonts.bunny.net" rel="preconnect"><link href="https://fonts.bunny.net/css?family=fira-mono:400,700%7Cfira-sans:400,400i,500,500i,700,700i%7Cfira-sans-condensed:700,700i%7Cpt-serif:400,400i,700,700i" rel="stylesheet" type="text/css"></head><body class="dark:bg-gray-900"><div id="clerk"></div><script type="module">let viewer = nextjournal.clerk.sci_env
let state = "{:bundle? false, :path->doc {\"notebooks/calculus\" {:path [], :nextjournal/value {:toc [{:title \"Calculus\", :emoji nil, :path \"#calculus\", :items [{:title \"Richardson extrapolation\", :emoji nil, :path \"#richardson-extrapolation\", :items [{:title \"Example - finite difference\", :emoji nil, :path \"#example---finite-difference\", :items []} {:title \"Example - infinite sum\", :emoji nil, :path \"#example---infinite-sum\", :items []} {:title \"Example - limit\", :emoji nil, :path \"#example---limit\", :items []}]} {:title \"Differentiation\", :emoji nil, :path \"#differentiation\", :items [{:title \"Derivative\", :emoji nil, :path \"#derivative\", :items []} {:title \"Gradient and Hessian\", :emoji nil, :path \"#gradient-and-hessian\", :items []}]} {:title \"Integration\", :emoji nil, :path \"#integration\", :items [{:title \"\", :emoji nil, :path \"#\", :items [{:title \"Examples\", :emoji nil, :path \"#examples\", :items []}]} {:title \"Multivariate\", :emoji nil, :path \"#multivariate\", :items [{:title \"Cubature\", :emoji nil, :path \"#cubature\", :items []} {:title \"VEGAS\", :emoji nil, :path \"#vegas\", :items []}]}]} {:title \"Solvers\", :emoji nil, :path \"#solvers\", :items [{:title \"Solver\", :emoji nil, :path \"#solver\", :items []} {:title \"Quadratic\", :emoji nil, :path \"#quadratic\", :items []}]}]} {:title \"List of symbols\", :emoji nil, :path \"#list-of-symbols\", :items []}], :sidenotes? false, :toc-visibility true, :atom-var-name->state #viewer-eval (nextjournal.clerk.render/intern-atoms! {}), :ns #viewer-eval (ns calculus), :file \"notebooks/calculus.clj\", :scope calculus, :bundle? false, :header {:path [], :nextjournal/value [:div.viewer.w-full.max-w-prose.px-8.not-prose.mt-3 [:div.mb-8.text-xs.sans-serif.text-slate-400 nil [:<> [:a.font-medium.border-b.border-dotted.border-slate-300.hover:text-indigo-500.hover:border-indigo-500.dark:border-slate-500.dark:hover:text-white.dark:hover:border-white.transition {:href \"./../../\"} \"Index\"] [:span.mx-2 \"•\"]] [:span \"Generated with \" [:a.font-medium.border-b.border-dotted.border-slate-300.hover:text-indigo-500.hover:border-indigo-500.dark:border-slate-500.dark:hover:text-white.dark:hover:border-white.transition {:href \"https://clerk.vision\"} \"Clerk\"] \" from \" [:a.font-medium.border-b.border-dotted.border-slate-300.hover:text-indigo-500.hover:border-indigo-500.dark:border-slate-500.dark:hover:text-white.dark:hover:border-white.transition {:href nil} \"notebooks/calculus.clj\" nil]]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}, :open-graph {:type \"article:clerk\", :title \"Calculus\", :description \"Integration, differentiation (finite difference), solvers and Richardson extrapolation.\"}, :title \"Calculus\", :blocks [{:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dsdGxoSaMnaKadaQNSg3d27qRVkkC\"} [\"h1\" {:id \"calculus\"} [:<> \"Calculus\"]] [:p [:<> \"Integration, differentiation (finite difference), solvers and Richardson extrapolation.\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dsdGxoSaMnaKadaQNSg3d27qRVkkC\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(require '[fastmath.calculus :as calc])\", :nextjournal/render-opts {:loc {:line 18, :end-line 19, :column 1, :end-column 40}, :id \"calculus/anon-expr-5dtcXmtga5SYWQDMgWiSUtHCbsVcMV-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dtEHguJS17v2V34sHMgmWAAQTP4zT\"} [\"h2\" {:id \"richardson-extrapolation\"} [:<> \"Richardson extrapolation\"]] [:p [:a {:href \"https://en.wikipedia.org/wiki/Richardson_extrapolation\"} [:<> \"Richardson extrapolation\"]] [:<> \" is a way to increase accuracy and convergence of limits of the form:\"]] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"f(x) = \\\\lim_{h\\\\to 0}g(x,h)\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}] [:p [:<> \"If \"] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"x = \\\\infty\", :nextjournal/viewer {:name :nextjournal.markdown/formula, :render-fn #viewer-fn (fn [tex] (nextjournal.clerk.render/render-katex tex {:inline? true})), :hash \"5dtTBivp9Yiw7XSqxv1opZHNencsu6\"}}] [:<> \" the following limit is calculated (similar for negative infinity):\"]] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"f(\\\\infty) = \\\\lim_{h\\\\to 0}g(0,\\\\frac{1}{h})\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}] [:p [:<> \"There are two helpers which create \"] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"g(x,h)\", :nextjournal/viewer {:name :nextjournal.markdown/formula, :render-fn #viewer-fn (fn [tex] (nextjournal.clerk.render/render-katex tex {:inline? true})), :hash \"5dtTBivp9Yiw7XSqxv1opZHNencsu6\"}}] [:<> \" from any single arity function: \"] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"g_+(x,h) = f(x+h)\", :nextjournal/viewer {:name :nextjournal.markdown/formula, :render-fn #viewer-fn (fn [tex] (nextjournal.clerk.render/render-katex tex {:inline? true})), :hash \"5dtTBivp9Yiw7XSqxv1opZHNencsu6\"}}] [:<> \" and \"] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"g_-(x,h) = f(x-h)\", :nextjournal/viewer {:name :nextjournal.markdown/formula, :render-fn #viewer-fn (fn [tex] (nextjournal.clerk.render/render-katex tex {:inline? true})), :hash \"5dtTBivp9Yiw7XSqxv1opZHNencsu6\"}}] [:<> \".\"]] [:p [:<> \"List of the functions:\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dtEHguJS17v2V34sHMgmWAAQTP4zT\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value \"symbol\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 1], :nextjournal/value \"info\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-head-viewer, :render-fn #viewer-fn (fn [header-row {:as opts, :keys [path number-col?]}] [:thead (into [:tr] (map-indexed (fn [i {:as header-cell, :nextjournal/keys [value]}] (let [title (when (or (string? value) (keyword? value) (symbol? value)) value)] [:th.pl-6.pr-2.py-1.align-bottom.font-medium.top-0.z-10.bg-white.dark:bg-slate-900.border-b.border-gray-300.dark:border-slate-700 (cond-> {:class (when (and (ifn? number-col?) (number-col? i)) \"text-right\")} title (assoc :title title)) (nextjournal.clerk.render/inspect-presented opts header-cell)]))) header-row)]), :hash \"5dsuyZRvJwykvdxHCRoj1p24Ru4wYR\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value [{:path [1 0 0], :nextjournal/value \"extrapolate\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}} {:path [1 0 1], :nextjournal/value \"Create extrapolated function f(x) from a function g(x,h)\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 1], :nextjournal/value [{:path [1 1 0], :nextjournal/value \"fx->gx+h\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}} {:path [1 1 1], :nextjournal/value \"Create g+\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 2], :nextjournal/value [{:path [1 2 0], :nextjournal/value \"fx->gx-h\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}} {:path [1 2 1], :nextjournal/value \"Create g-\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-body-viewer, :render-fn #viewer-fn (fn [rows opts] (into [:tbody] (map-indexed (fn [idx row] (nextjournal.clerk.render/inspect-presented (update opts :path conj idx) row))) rows)), :hash \"5dsefivD6wgJ7qkFYswJThKvfZ3x3P\"}}], :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 2, :number-col? #{}, :id \"calculus/anon-expr-5dtmDpFpGaH58XfsopWL71BGvBdu5x-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/table-markup-viewer, :render-fn #viewer-fn (fn [head+body opts] [:div (into [nextjournal.clerk.render/render-table-with-sticky-header] (nextjournal.clerk.render/inspect-children opts) head+body)]), :hash \"5drXFLdHZgfgZHMAR1nVZrHeF8oNVJ\"}}, :nextjournal/blob-id \"5dsnorrnT7z4mNjqwjosaSS3kMcFcF\"}, :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 2, :number-col? #{}, :id \"calculus/anon-expr-5dtmDpFpGaH58XfsopWL71BGvBdu5x-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dtDXo1nnEDjPcELAnEjwVHHmBan3Z\"} [:p [:code [:<> \"extrapolate\"]] [:<> \" accepts following options:\"]] [:ul [:li [:<> [:code [:<> \":contract\"]] [:<> \" - \"] [:code [:<> \"h\"]] [:<> \" shrinkage factor, default=\"] [:code [:<> \"1/2\"]]]] [:li [:<> [:code [:<> \":power\"]] [:<> \" - set to \"] [:code [:<> \"2.0\"]] [:<> \" for even functions around \"] [:code [:<> \"x0\"]] [:<> \", default \"] [:code [:<> \"1.0\"]]]] [:li [:<> [:code [:<> \":init-h\"]] [:<> \" - initial step \"] [:code [:<> \"h\"]] [:<> \", default=\"] [:code [:<> \"1/2\"]]]] [:li [:<> [:code [:<> \":abs\"]] [:<> \" - absolute error, default: machine epsilon\"]]] [:li [:<> [:code [:<> \":rel\"]] [:<> \" - relative error, default: ulp for init-h\"]]] [:li [:<> [:code [:<> \":tol\"]] [:<> \" - tolerance for current error, default: \"] [:code [:<> \"2.0\"]]]] [:li [:<> [:code [:<> \":max-evals\"]] [:<> \" - maximum evaluations, default: maximum integer\"]]]] [\"h3\" {:id \"example---finite-difference\"} [:<> \"Example - finite difference\"]] [:p [:<> \"As the first example let's see how extrapolation increases accuracy for finite differences method. Let's define.\"]] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"f(x)=x\\\\sin{x}\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}]], :nextjournal/render-opts {:id \"calculus/markdown-5dtDXo1nnEDjPcELAnEjwVHHmBan3Z\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(defn xsinx [x] (* x (m/sin x)))\", :nextjournal/render-opts {:loc {:line 57, :end-line 58, :column 1, :end-column 33}, :id \"calculus/xsinx-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5drVEjgkceiWaKULUyAHZPbYPpd9Rh\"} [:p [:<> \"And actual derivative\"]] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"f'(x)=\\\\sin{x}+x\\\\cos{x}\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}]], :nextjournal/render-opts {:id \"calculus/markdown-5drVEjgkceiWaKULUyAHZPbYPpd9Rh\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(defn xsinx' [x] (+ (m/sin x) (* x (m/cos x))))\", :nextjournal/render-opts {:loc {:line 64, :end-line 65, :column 1, :end-column 48}, :id \"calculus/xsinx'-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dtBuFSpywookWyf9qw2A2SqzJSkZf\"} [:p [:<> \"Value of derivative for \"] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"x=0.5\", :nextjournal/viewer {:name :nextjournal.markdown/formula, :render-fn #viewer-fn (fn [tex] (nextjournal.clerk.render/render-katex tex {:inline? true})), :hash \"5dtTBivp9Yiw7XSqxv1opZHNencsu6\"}}] [:<> \" equals:\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dtBuFSpywookWyf9qw2A2SqzJSkZf\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(xsinx' 0.5)\", :nextjournal/render-opts {:loc {:line 69, :end-line 69, :column 1, :end-column 13}, :id \"calculus/anon-expr-5dtVU3HmoAnhzJ2ffD8v9BMyS6Lbw3-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value 0.9182168195493894, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dtVU3HmoAnhzJ2ffD8v9BMyS6Lbw3-result\"}}, :nextjournal/blob-id \"5duDzdYU1ZWFFeZsZ1qLa9m6pvoFtU\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dtVU3HmoAnhzJ2ffD8v9BMyS6Lbw3-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dsJmVSVPGC9wdQPxHuqyryTdwMmP2\"} [:p [:<> \"Now let's define finite difference version of derivative\"]] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"f'(x,h) \\\\approx f'_{fd}(x,h) = \\\\frac{f(x+h)-f(x)}{h}\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}]], :nextjournal/render-opts {:id \"calculus/markdown-5dsJmVSVPGC9wdQPxHuqyryTdwMmP2\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(defn xsinx-finite-diff [x h] (/ (- (xsinx (+ x h)) (xsinx x)) h))\", :nextjournal/render-opts {:loc {:line 75, :end-line 76, :column 1, :end-column 67}, :id \"calculus/xsinx-finite-diff-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5ds6CVRBvu7atxwqbpJESSGageHEeG\"} [:p [:<> \"For low \"] [:code [:<> \"h\"]] [:<> \" the result is close to the actual value:\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5ds6CVRBvu7atxwqbpJESSGageHEeG\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(xsinx-finite-diff 0.5 1.0e-6)\", :nextjournal/render-opts {:loc {:line 80, :end-line 80, :column 1, :end-column 31}, :id \"calculus/anon-expr-5drLtgtaaN3ffcwErcii3tzjJv25cP-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value 0.9182175773059242, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5drLtgtaaN3ffcwErcii3tzjJv25cP-result\"}}, :nextjournal/blob-id \"5duG2RCeoPdynZ4WQ9KtoHuiCdb7hX\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5drLtgtaaN3ffcwErcii3tzjJv25cP-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5duLfCgUTPggSDdF7BLK1Rm4noqRhJ\"} [:p [:<> \"We list what is the error when \"] [:code [:<> \"h\"]] [:<> \" goes to \"] [:code [:<> \"0.0\"]] [:<> \". Observe, that the best results is for \"] [:code [:<> \"h\"]] [:<> \" equal \"] [:code [:<> \"1.0e-6\"]] [:<> \" with error around \"] [:code [:<> \"1.0e-8\"]] [:<> \".\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5duLfCgUTPggSDdF7BLK1Rm4noqRhJ\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value \"h\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 1], :nextjournal/value \"finite difference\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 2], :nextjournal/value \"error\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-head-viewer, :render-fn #viewer-fn (fn [header-row {:as opts, :keys [path number-col?]}] [:thead (into [:tr] (map-indexed (fn [i {:as header-cell, :nextjournal/keys [value]}] (let [title (when (or (string? value) (keyword? value) (symbol? value)) value)] [:th.pl-6.pr-2.py-1.align-bottom.font-medium.top-0.z-10.bg-white.dark:bg-slate-900.border-b.border-gray-300.dark:border-slate-700 (cond-> {:class (when (and (ifn? number-col?) (number-col? i)) \"text-right\")} title (assoc :title title)) (nextjournal.clerk.render/inspect-presented opts header-cell)]))) header-row)]), :hash \"5dsuyZRvJwykvdxHCRoj1p24Ru4wYR\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value [{:path [1 0 0], :nextjournal/value 1.0, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 0 1], :nextjournal/value 1.25652971060398, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 0 2], :nextjournal/value 0.3383128910545907, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 1], :nextjournal/value [{:path [1 1 0], :nextjournal/value 0.1, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 1 1], :nextjournal/value 0.9907271473491971, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 1 2], :nextjournal/value 0.0725103277998077, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 2], :nextjournal/value [{:path [1 2 0], :nextjournal/value 0.01, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 2 1], :nextjournal/value 0.9257626608181385, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 2 2], :nextjournal/value 0.007545841268749132, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 3], :nextjournal/value [{:path [1 3 0], :nextjournal/value 0.001, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 3 1], :nextjournal/value 0.9189742327457007, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 3 2], :nextjournal/value 7.574131963112851E-4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 4], :nextjournal/value [{:path [1 4 0], :nextjournal/value 1.0E-4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 4 1], :nextjournal/value 0.9182925890383054, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 4 2], :nextjournal/value 7.576948891596658E-5, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 5], :nextjournal/value [{:path [1 5 0], :nextjournal/value 1.0E-5, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 5 1], :nextjournal/value 0.9182243967759128, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 5 2], :nextjournal/value 7.5772265234475E-6, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 6], :nextjournal/value [{:path [1 6 0], :nextjournal/value 1.0E-6, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 6 1], :nextjournal/value 0.9182175773059242, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 6 2], :nextjournal/value 7.577565348526605E-7, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 7], :nextjournal/value [{:path [1 7 0], :nextjournal/value 1.0E-7, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 7 1], :nextjournal/value 0.9182168947408087, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 7 2], :nextjournal/value 7.519141931311424E-8, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 8], :nextjournal/value [{:path [1 8 0], :nextjournal/value 1.0E-8, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 8 1], :nextjournal/value 0.9182168303478733, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 8 2], :nextjournal/value 1.0798483884855159E-8, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 9], :nextjournal/value [{:path [1 9 0], :nextjournal/value 1.0E-9, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 9 1], :nextjournal/value 0.918216780387837, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 9 2], :nextjournal/value 3.916155233429919E-8, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 10], :nextjournal/value [{:path [1 10 0], :nextjournal/value 1.0E-10, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 10 1], :nextjournal/value 0.9182168914101396, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 10 2], :nextjournal/value 7.186075023923877E-8, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 11], :nextjournal/value [{:path [1 11 0], :nextjournal/value 1.0E-11, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 11 1], :nextjournal/value 0.918215503631359, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 11 2], :nextjournal/value 1.3159180304311846E-6, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 12], :nextjournal/value [{:path [1 12 0], :nextjournal/value 1.0E-12, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 12 1], :nextjournal/value 0.9181821969406201, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 12 2], :nextjournal/value 3.46226087692969E-5, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 13], :nextjournal/value [{:path [1 13 0], :nextjournal/value 1.0E-13, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 13 1], :nextjournal/value 0.9184319971211607, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 13 2], :nextjournal/value 2.1517757177136332E-4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 14], :nextjournal/value [{:path [1 14 0], :nextjournal/value 1.0E-14, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 14 1], :nextjournal/value 0.918709552877317, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 14 2], :nextjournal/value 4.927333279276525E-4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 15], :nextjournal/value [{:path [1 15 0], :nextjournal/value 1.0E-15, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 15 1], :nextjournal/value 0.8881784197001251, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 15 2], :nextjournal/value 0.030038399849264263, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 16], :nextjournal/value [{:path [1 16 0], :nextjournal/value 1.0E-16, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 16 1], :nextjournal/value 0.8326672684688674, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 16 2], :nextjournal/value 0.08554955108052198, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 17], :nextjournal/value [{:path [1 17 0], :nextjournal/value 1.0E-17, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 17 1], :nextjournal/value 0.0, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 17 2], :nextjournal/value 0.9182168195493894, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-body-viewer, :render-fn #viewer-fn (fn [rows opts] (into [:tbody] (map-indexed (fn [idx row] (nextjournal.clerk.render/inspect-presented (update opts :path conj idx) row))) rows)), :hash \"5dsefivD6wgJ7qkFYswJThKvfZ3x3P\"}}], :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 3, :number-col? #{0 1 2}, :id \"calculus/anon-expr-5duGoFnWjB129nCDgrftjTiW65JEir-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/table-markup-viewer, :render-fn #viewer-fn (fn [head+body opts] [:div (into [nextjournal.clerk.render/render-table-with-sticky-header] (nextjournal.clerk.render/inspect-children opts) head+body)]), :hash \"5drXFLdHZgfgZHMAR1nVZrHeF8oNVJ\"}}, :nextjournal/blob-id \"5duCputqKAjDULGUEb49MokCGbKdqo\"}, :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 3, :number-col? #{0 1 2}, :id \"calculus/anon-expr-5duGoFnWjB129nCDgrftjTiW65JEir-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dsrcP4qsMdvkjwUVKXDt4J11y6YSs\"} [:p [:<> \"Now, let's construct extrapolated version of our finite difference derivative\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dsrcP4qsMdvkjwUVKXDt4J11y6YSs\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(def xsinx-finite-diff+ (calc/extrapolate xsinx-finite-diff))\", :nextjournal/render-opts {:loc {:line 94, :end-line 95, :column 1, :end-column 62}, :id \"calculus/xsinx-finite-diff+-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5duFdES7CLisp9K1RTJ9ZSuBLLVBBR\"} [:p [:<> \"Extrapolated value is:\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5duFdES7CLisp9K1RTJ9ZSuBLLVBBR\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(xsinx-finite-diff+ 0.5)\", :nextjournal/render-opts {:loc {:line 99, :end-line 99, :column 1, :end-column 25}, :id \"calculus/anon-expr-5drcW3p2qab36hzeFFGWfyaqpVm4bw-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value 0.9182168195493955, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5drcW3p2qab36hzeFFGWfyaqpVm4bw-result\"}}, :nextjournal/blob-id \"5dsSMCGafr48TvBjEWmDiWLVVXtqew\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5drcW3p2qab36hzeFFGWfyaqpVm4bw-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5drfKPh7UuzghesVf6YwEW9HTzcvxf\"} [:p [:<> \"with the error close to \"] [:code [:<> \"6.0e-15\"]] [:<> \", which is much better than the default approach.\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5drfKPh7UuzghesVf6YwEW9HTzcvxf\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(- (xsinx-finite-diff+ 0.5) (xsinx' 0.5))\", :nextjournal/render-opts {:loc {:line 103, :end-line 103, :column 1, :end-column 42}, :id \"calculus/anon-expr-5ds727Z4g8Dy4ZzdDcFpUPRaNnucqr-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value 6.106226635438361E-15, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5ds727Z4g8Dy4ZzdDcFpUPRaNnucqr-result\"}}, :nextjournal/blob-id \"5drrMD4AmX9K1MjXCPCoT3n7RHHnx2\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5ds727Z4g8Dy4ZzdDcFpUPRaNnucqr-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dr7ofbaCmTwNLKKMxcw87vHqKezFa\"} [\"h3\" {:id \"example---infinite-sum\"} [:<> \"Example - infinite sum\"]] [:p [:<> \"In the second example we will try to calculate the following infinite sum:\"]] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"\\\\sum_{n=1}^\\\\infty\\\\frac{1}{n^2} = \\\\frac{\\\\pi^2}{6}\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}]], :nextjournal/render-opts {:id \"calculus/markdown-5dr7ofbaCmTwNLKKMxcw87vHqKezFa\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(defn infinite-sum\\n  [n]\\n  (->> (range 1 (inc n))\\n       (map (fn [^double x] (/ 1.0 (* x x))))\\n       (reduce + )))\", :nextjournal/render-opts {:loc {:line 111, :end-line 116, :column 1, :end-column 21}, :id \"calculus/infinite-sum-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5drd2F6ndPrEXvEp5eKfaq2689N5hj\"} [:p [:<> \"We list value and error for various \"] [:code [:<> \"n\"]] [:<> \". Worth to mention that the last position for \"] [:code [:<> \"n=1.0e9\"]] [:<> \" takes around 20 seconds on my PC.\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5drd2F6ndPrEXvEp5eKfaq2689N5hj\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value \"n\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 1], :nextjournal/value \"infinite sum\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 2], :nextjournal/value \"error\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-head-viewer, :render-fn #viewer-fn (fn [header-row {:as opts, :keys [path number-col?]}] [:thead (into [:tr] (map-indexed (fn [i {:as header-cell, :nextjournal/keys [value]}] (let [title (when (or (string? value) (keyword? value) (symbol? value)) value)] [:th.pl-6.pr-2.py-1.align-bottom.font-medium.top-0.z-10.bg-white.dark:bg-slate-900.border-b.border-gray-300.dark:border-slate-700 (cond-> {:class (when (and (ifn? number-col?) (number-col? i)) \"text-right\")} title (assoc :title title)) (nextjournal.clerk.render/inspect-presented opts header-cell)]))) header-row)]), :hash \"5dsuyZRvJwykvdxHCRoj1p24Ru4wYR\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value [{:path [1 0 0], :nextjournal/value 10, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 0 1], :nextjournal/value 1.5497677311665408, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 0 2], :nextjournal/value 0.09516633568168564, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 1], :nextjournal/value [{:path [1 1 0], :nextjournal/value 100, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 1 1], :nextjournal/value 1.6349839001848923, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 1 2], :nextjournal/value 0.009950166663334148, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 2], :nextjournal/value [{:path [1 2 0], :nextjournal/value 1000, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 2 1], :nextjournal/value 1.6439345666815615, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 2 2], :nextjournal/value 9.995001666649461E-4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 3], :nextjournal/value [{:path [1 3 0], :nextjournal/value 10000, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 3 1], :nextjournal/value 1.6448340718480652, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 3 2], :nextjournal/value 9.999500016122376E-5, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 4], :nextjournal/value [{:path [1 4 0], :nextjournal/value 100000, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 4 1], :nextjournal/value 1.6449240668982423, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 4 2], :nextjournal/value 9.999949984074163E-6, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 5], :nextjournal/value [{:path [1 5 0], :nextjournal/value 1000000, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 5 1], :nextjournal/value 1.64493306684877, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 5 2], :nextjournal/value 9.999994563525405E-7, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 6], :nextjournal/value [{:path [1 6 0], :nextjournal/value 10000000, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 6 1], :nextjournal/value 1.6449339668472596, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 6 2], :nextjournal/value 1.0000096684059656E-7, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 7], :nextjournal/value [{:path [1 7 0], :nextjournal/value 100000000, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 7 1], :nextjournal/value 1.644934057834575, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 7 2], :nextjournal/value 9.013651380840315E-9, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-body-viewer, :render-fn #viewer-fn (fn [rows opts] (into [:tbody] (map-indexed (fn [idx row] (nextjournal.clerk.render/inspect-presented (update opts :path conj idx) row))) rows)), :hash \"5dsefivD6wgJ7qkFYswJThKvfZ3x3P\"}}], :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 3, :number-col? #{0 1 2}, :id \"calculus/anon-expr-5dt3LGmHmjchPgtgiofj45AGnGucZS-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/table-markup-viewer, :render-fn #viewer-fn (fn [head+body opts] [:div (into [nextjournal.clerk.render/render-table-with-sticky-header] (nextjournal.clerk.render/inspect-children opts) head+body)]), :hash \"5drXFLdHZgfgZHMAR1nVZrHeF8oNVJ\"}}, :nextjournal/blob-id \"5dsiPHuq7xRcGkzQDFjQNqaB5q9psy\"}, :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 3, :number-col? #{0 1 2}, :id \"calculus/anon-expr-5dt3LGmHmjchPgtgiofj45AGnGucZS-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dryyzsRRiZFgDCbu1JB6ZEraxuG3v\"} [:p [:<> \"Now let's evaluate extrapolated version at infinity. Relative tolerance is set to \"] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"0.0\", :nextjournal/viewer {:name :nextjournal.markdown/formula, :render-fn #viewer-fn (fn [tex] (nextjournal.clerk.render/render-katex tex {:inline? true})), :hash \"5dtTBivp9Yiw7XSqxv1opZHNencsu6\"}}] [:<> \" to stop only on absolute tolerance.\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dryyzsRRiZFgDCbu1JB6ZEraxuG3v\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(def infinite-sum+ (-> infinite-sum\\n                     (calc/fx->gx+h) ;; convert to g(x,h)=f(x+h)\\n                     (calc/extrapolate {:rel 0})))\", :nextjournal/render-opts {:loc {:line 130, :end-line 133, :column 1, :end-column 51}, :id \"calculus/infinite-sum+-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5drwpe1Jj1abmzYPhnkBdtX3Bj2fLT\"} [:p [:<> \"From the debugging we know that evaluation stops for \"] [:code [:<> \"n=2048\"]]]], :nextjournal/render-opts {:id \"calculus/markdown-5drwpe1Jj1abmzYPhnkBdtX3Bj2fLT\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(infinite-sum+ ##Inf)\", :nextjournal/render-opts {:loc {:line 137, :end-line 137, :column 1, :end-column 22}, :id \"calculus/anon-expr-5dtnYtDi5MMYrkKpAFEXQfs6TJM3iv-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value 1.6449340668482308, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dtnYtDi5MMYrkKpAFEXQfs6TJM3iv-result\"}}, :nextjournal/blob-id \"5dtsMzw2JGBPgH1mpbpP9ZGWm9oneh\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dtnYtDi5MMYrkKpAFEXQfs6TJM3iv-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dqt8WPnDBRn12ywvUvwkPksLzsox7\"} [:p [:<> \"and the error is around \"] [:code [:<> \"5.0e-15\"]]]], :nextjournal/render-opts {:id \"calculus/markdown-5dqt8WPnDBRn12ywvUvwkPksLzsox7\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(- (infinite-sum+ ##Inf) (/ (* m/PI m/PI) 6.0))\", :nextjournal/render-opts {:loc {:line 141, :end-line 141, :column 1, :end-column 48}, :id \"calculus/anon-expr-5duHFzXWVKDqRRQ5cZjCqNDf3Jq21e-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value 4.440892098500626E-15, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5duHFzXWVKDqRRQ5cZjCqNDf3Jq21e-result\"}}, :nextjournal/blob-id \"5dtbKYpsfGRNJ5xYyMUY6WebMcJ9mQ\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5duHFzXWVKDqRRQ5cZjCqNDf3Jq21e-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dr6mbkMb5vymh6FTBUp7qpGzaMUW6\"} [\"h3\" {:id \"example---limit\"} [:<> \"Example - limit\"]] [:p [:<> \"In another example we will calculate the following limit:\"]] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"\\\\lim_{x\\\\to \\\\infty}\\\\frac{\\\\ln(x)}{x} = 0\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}]], :nextjournal/render-opts {:id \"calculus/markdown-5dr6mbkMb5vymh6FTBUp7qpGzaMUW6\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(defn limit-example [x] (/ (m/ln x) x))\", :nextjournal/render-opts {:loc {:line 149, :end-line 150, :column 1, :end-column 40}, :id \"calculus/limit-example-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value \"(limit-example Double/MAX_VALUE)\", :nextjournal/render-opts {:loc {:line 152, :end-line 152, :column 1, :end-column 33}, :id \"calculus/anon-expr-5du1qy1kjve27NWUH8cPWfEjpSi3Di-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value 3.948297399198478E-306, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5du1qy1kjve27NWUH8cPWfEjpSi3Di-result\"}}, :nextjournal/blob-id \"5drhHvhjJpTjnudaqKNhoBCiCnREgM\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5du1qy1kjve27NWUH8cPWfEjpSi3Di-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dsGGai7RhGZQrycAE9GJsCkd69fLW\"} [:p [:<> \"First approach shows that this limit behaves badly when extrapolated. The result is far from beeing accurate.\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dsGGai7RhGZQrycAE9GJsCkd69fLW\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(def limit-example+-bad (-> limit-example\\n                          (calc/fx->gx+h)\\n                          (calc/extrapolate)))\", :nextjournal/render-opts {:loc {:line 156, :end-line 159, :column 1, :end-column 47}, :id \"calculus/limit-example+-bad-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value \"(limit-example+-bad ##Inf)\", :nextjournal/render-opts {:loc {:line 161, :end-line 161, :column 1, :end-column 27}, :id \"calculus/anon-expr-5dsrdKnLmsPrDTsL6mRSMJ19PpkPwq-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value 0.34657359027997264, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dsrdKnLmsPrDTsL6mRSMJ19PpkPwq-result\"}}, :nextjournal/blob-id \"5dsm8Mk5jXwfPUJ7GSVeMTKfiMmNp6\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dsrdKnLmsPrDTsL6mRSMJ19PpkPwq-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5du1Bf9sz5BNTaGSE5KYTX7E73GezU\"} [:p [:<> \"To fix it we need to raise the initial \"] [:code [:<> \"h\"]] [:<> \" and turn off the absolute tolerance checking (and rely only on the relative tolerance)\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5du1Bf9sz5BNTaGSE5KYTX7E73GezU\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(def limit-example+-good (-> limit-example\\n                           (calc/fx->gx+h)\\n                           (calc/extrapolate {:init-h 10 :abs 0})))\", :nextjournal/render-opts {:loc {:line 165, :end-line 168, :column 1, :end-column 68}, :id \"calculus/limit-example+-good-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value \"(limit-example+-good ##Inf)\", :nextjournal/render-opts {:loc {:line 170, :end-line 170, :column 1, :end-column 28}, :id \"calculus/anon-expr-5dta1eGG9M3Ya6iyTMddiNRfHq2Gdn-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value 4.819698973636105E-309, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dta1eGG9M3Ya6iyTMddiNRfHq2Gdn-result\"}}, :nextjournal/blob-id \"5dtqzQiMLMhpjdf3C6CV9EqqP5BTgT\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dta1eGG9M3Ya6iyTMddiNRfHq2Gdn-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dtyRG5w9ZaEBS6fvfezxpDXcqvcUz\"} [\"h2\" {:id \"differentiation\"} [:<> \"Differentiation\"]] [:p [:<> \"Differentiation is based on \"] [:a {:href \"https://en.wikipedia.org/wiki/Finite_difference\"} [:<> \"finite difference\"]] [:<> \" method. Forward, backward and central difference methods are possible. Any order with any \"] [:a {:href \"https://en.wikipedia.org/wiki/Finite_difference_coefficient\"} [:<> \"accuracy coefficients\"]] [:<> \" are supported.\"]] [:p [:<> \"Please note that higher orders and higher accuracy can be not stable.\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dtyRG5w9ZaEBS6fvfezxpDXcqvcUz\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value \"symbol\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 1], :nextjournal/value \"info\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-head-viewer, :render-fn #viewer-fn (fn [header-row {:as opts, :keys [path number-col?]}] [:thead (into [:tr] (map-indexed (fn [i {:as header-cell, :nextjournal/keys [value]}] (let [title (when (or (string? value) (keyword? value) (symbol? value)) value)] [:th.pl-6.pr-2.py-1.align-bottom.font-medium.top-0.z-10.bg-white.dark:bg-slate-900.border-b.border-gray-300.dark:border-slate-700 (cond-> {:class (when (and (ifn? number-col?) (number-col? i)) \"text-right\")} title (assoc :title title)) (nextjournal.clerk.render/inspect-presented opts header-cell)]))) header-row)]), :hash \"5dsuyZRvJwykvdxHCRoj1p24Ru4wYR\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value [{:path [1 0 0], :nextjournal/value \"derivative\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}} {:path [1 0 1], :nextjournal/value \"Generate nth order derivative\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 1], :nextjournal/value [{:path [1 1 0], :nextjournal/value \"f'\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}} {:path [1 1 1], :nextjournal/value \"First derivative\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 2], :nextjournal/value [{:path [1 2 0], :nextjournal/value \"f''\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}} {:path [1 2 1], :nextjournal/value \"Second derivative\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 3], :nextjournal/value [{:path [1 3 0], :nextjournal/value \"f'''\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}} {:path [1 3 1], :nextjournal/value \"Third derivative\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 4], :nextjournal/value [{:path [1 4 0], :nextjournal/value \"gradient\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}} {:path [1 4 1], :nextjournal/value \"Grandient of the scalar valued function of several variables\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 5], :nextjournal/value [{:path [1 5 0], :nextjournal/value \"hessian\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}} {:path [1 5 1], :nextjournal/value \"Matrix of second derivatives of scalar valued function of several variables\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-body-viewer, :render-fn #viewer-fn (fn [rows opts] (into [:tbody] (map-indexed (fn [idx row] (nextjournal.clerk.render/inspect-presented (update opts :path conj idx) row))) rows)), :hash \"5dsefivD6wgJ7qkFYswJThKvfZ3x3P\"}}], :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 2, :number-col? #{}, :id \"calculus/anon-expr-5drrra46pG4trcNuZc1ZRdFghnwvB3-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/table-markup-viewer, :render-fn #viewer-fn (fn [head+body opts] [:div (into [nextjournal.clerk.render/render-table-with-sticky-header] (nextjournal.clerk.render/inspect-children opts) head+body)]), :hash \"5drXFLdHZgfgZHMAR1nVZrHeF8oNVJ\"}}, :nextjournal/blob-id \"5dsk4s2BbsL67y3iNbedQxD6dYjWFy\"}, :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 2, :number-col? #{}, :id \"calculus/anon-expr-5drrra46pG4trcNuZc1ZRdFghnwvB3-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dtQ75acXneUeN2zonxdpuXX757KrG\"} [\"h3\" {:id \"derivative\"} [:<> \"Derivative\"]] [:p [:code [:<> \"derivative\"]] [:<> \" creates a \"] [:code [:<> \"n\"]] [:<> \"th order (default: first) derivative of the input function as another function. Possible options are:\"]] [:ul [:li [:<> [:code [:<> \":h\"]] [:<> \" - step, default: \"] [:code [:<> \"0.0\"]] [:<> \" - automatic\"]]] [:li [:<> [:code [:<> \":acc\"]] [:<> \" - order of accuracy, default: \"] [:code [:<> \"2\"]]]] [:li [:<> [:code [:<> \":method\"]] [:<> \" - one of: \"] [:code [:<> \":forward\"]] [:<> \", \"] [:code [:<> \":backward\"]] [:<> \" or \"] [:code [:<> \":central\"]] [:<> \" (default)\"]]] [:li [:<> [:code [:<> \":extrapolate?\"]] [:<> \" - if true creates an extrapolated version, optionally a map of \"] [:code [:<> \"extrapolate\"]] [:<> \" options can be passed\"]]]]], :nextjournal/render-opts {:id \"calculus/markdown-5dtQ75acXneUeN2zonxdpuXX757KrG\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(def xsinx-diff (calc/derivative xsinx))\", :nextjournal/render-opts {:loc {:line 196, :end-line 197, :column 1, :end-column 41}, :id \"calculus/xsinx-diff-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value \"(xsinx-diff 0.5)\", :nextjournal/render-opts {:loc {:line 199, :end-line 199, :column 1, :end-column 17}, :id \"calculus/anon-expr-5drUhtjvGYzkkmjccd3kTtoCbPYxoV-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value 0.9182168195424955, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5drUhtjvGYzkkmjccd3kTtoCbPYxoV-result\"}}, :nextjournal/blob-id \"5dqxtTKtjvetTA5AUpbCdnqAVZnuYm\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5drUhtjvGYzkkmjccd3kTtoCbPYxoV-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dsyMuyxCh1dFVShVKEmcxH5qFhXJ2\"} [:p [:<> \"Let's list all the possible values for first derivative and different accuracy, method and extrapolation\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dsyMuyxCh1dFVShVKEmcxH5qFhXJ2\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value \"accuracy\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 1], :nextjournal/value \"method\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 2], :nextjournal/value \"extrapolation?\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 3], :nextjournal/value \"f'(0.5)\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 4], :nextjournal/value \"error\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-head-viewer, :render-fn #viewer-fn (fn [header-row {:as opts, :keys [path number-col?]}] [:thead (into [:tr] (map-indexed (fn [i {:as header-cell, :nextjournal/keys [value]}] (let [title (when (or (string? value) (keyword? value) (symbol? value)) value)] [:th.pl-6.pr-2.py-1.align-bottom.font-medium.top-0.z-10.bg-white.dark:bg-slate-900.border-b.border-gray-300.dark:border-slate-700 (cond-> {:class (when (and (ifn? number-col?) (number-col? i)) \"text-right\")} title (assoc :title title)) (nextjournal.clerk.render/inspect-presented opts header-cell)]))) header-row)]), :hash \"5dsuyZRvJwykvdxHCRoj1p24Ru4wYR\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value [{:path [1 0 0], :nextjournal/value 2, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 0 1], :nextjournal/value :forward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 0 2], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 0 3], :nextjournal/value 0.9182168195771451, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 0 4], :nextjournal/value 2.7755686637931376E-11, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 1], :nextjournal/value [{:path [1 1 0], :nextjournal/value 2, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 1 1], :nextjournal/value :forward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 1 2], :nextjournal/value true, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 1 3], :nextjournal/value 0.918216819549471, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 1 4], :nextjournal/value 8.1601392309949E-14, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 2], :nextjournal/value [{:path [1 2 0], :nextjournal/value 2, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 2 1], :nextjournal/value :backward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 2 2], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 2 3], :nextjournal/value 0.9182168195482704, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 2 4], :nextjournal/value 1.1189937865196953E-12, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 3], :nextjournal/value [{:path [1 3 0], :nextjournal/value 2, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 3 1], :nextjournal/value :backward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 3 2], :nextjournal/value true, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 3 3], :nextjournal/value 0.9182168195494003, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 3 4], :nextjournal/value 1.0880185641326534E-14, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 4], :nextjournal/value [{:path [1 4 0], :nextjournal/value 2, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 4 1], :nextjournal/value :central, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 4 2], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 4 3], :nextjournal/value 0.9182168195424955, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 4 4], :nextjournal/value 6.8939298714099095E-12, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 5], :nextjournal/value [{:path [1 5 0], :nextjournal/value 2, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 5 1], :nextjournal/value :central, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 5 2], :nextjournal/value true, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 5 3], :nextjournal/value 0.9182168195493906, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 5 4], :nextjournal/value 1.2212453270876722E-15, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 6], :nextjournal/value [{:path [1 6 0], :nextjournal/value 4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 6 1], :nextjournal/value :forward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 6 2], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 6 3], :nextjournal/value 0.918216819593026, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 6 4], :nextjournal/value 4.3636649849077E-11, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 7], :nextjournal/value [{:path [1 7 0], :nextjournal/value 4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 7 1], :nextjournal/value :forward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 7 2], :nextjournal/value true, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 7 3], :nextjournal/value 0.9182168195496083, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 7 4], :nextjournal/value 2.1893598045608087E-13, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 8], :nextjournal/value [{:path [1 8 0], :nextjournal/value 4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 8 1], :nextjournal/value :backward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 8 2], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 8 3], :nextjournal/value 0.9182168195251706, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 8 4], :nextjournal/value 2.4218738126080552E-11, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 9], :nextjournal/value [{:path [1 9 0], :nextjournal/value 4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 9 1], :nextjournal/value :backward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 9 2], :nextjournal/value true, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 9 3], :nextjournal/value 0.918216819549422, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 9 4], :nextjournal/value 3.26405569239796E-14, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 10], :nextjournal/value [{:path [1 10 0], :nextjournal/value 4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 10 1], :nextjournal/value :central, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 10 2], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 10 3], :nextjournal/value 0.9182168195511579, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 10 4], :nextjournal/value 1.7684742559254119E-12, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 11], :nextjournal/value [{:path [1 11 0], :nextjournal/value 4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 11 1], :nextjournal/value :central, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 11 2], :nextjournal/value true, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 11 3], :nextjournal/value 0.9182168195493914, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 11 4], :nextjournal/value 1.9984014443252818E-15, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 12], :nextjournal/value [{:path [1 12 0], :nextjournal/value 6, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 12 1], :nextjournal/value :forward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 12 2], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 12 3], :nextjournal/value 0.9182168196103508, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 12 4], :nextjournal/value 6.096145810374765E-11, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 13], :nextjournal/value [{:path [1 13 0], :nextjournal/value 6, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 13 1], :nextjournal/value :forward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 13 2], :nextjournal/value true, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 13 3], :nextjournal/value 0.9182168195411062, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 13 4], :nextjournal/value 8.283151942123368E-12, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 14], :nextjournal/value [{:path [1 14 0], :nextjournal/value 6, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 14 1], :nextjournal/value :backward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 14 2], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 14 3], :nextjournal/value 0.9182168194443215, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 14 4], :nextjournal/value 1.0506784331454355E-10, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 15], :nextjournal/value [{:path [1 15 0], :nextjournal/value 6, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 15 1], :nextjournal/value :backward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 15 2], :nextjournal/value true, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 15 3], :nextjournal/value 0.9182168195423657, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 15 4], :nextjournal/value 7.02371494298859E-12, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 16], :nextjournal/value [{:path [1 16 0], :nextjournal/value 6, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 16 1], :nextjournal/value :central, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 16 2], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 16 3], :nextjournal/value 0.9182168195560304, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 16 4], :nextjournal/value 6.641021066400299E-12, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 17], :nextjournal/value [{:path [1 17 0], :nextjournal/value 6, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 17 1], :nextjournal/value :central, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 17 2], :nextjournal/value true, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 17 3], :nextjournal/value 0.9182168195493954, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 17 4], :nextjournal/value 5.995204332975845E-15, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-body-viewer, :render-fn #viewer-fn (fn [rows opts] (into [:tbody] (map-indexed (fn [idx row] (nextjournal.clerk.render/inspect-presented (update opts :path conj idx) row))) rows)), :hash \"5dsefivD6wgJ7qkFYswJThKvfZ3x3P\"}}], :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 5, :number-col? #{0 4 3}, :id \"calculus/anon-expr-5ds8KthyZVGwoD5dza6na8cNo55cat-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/table-markup-viewer, :render-fn #viewer-fn (fn [head+body opts] [:div (into [nextjournal.clerk.render/render-table-with-sticky-header] (nextjournal.clerk.render/inspect-children opts) head+body)]), :hash \"5drXFLdHZgfgZHMAR1nVZrHeF8oNVJ\"}}, :nextjournal/blob-id \"5dsiEijEbmus5zcFS636VZb81Vmvpt\"}, :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 5, :number-col? #{0 4 3}, :id \"calculus/anon-expr-5ds8KthyZVGwoD5dza6na8cNo55cat-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dr397Let29CiJBK6aqaxkdCyZ7GrQ\"} [:p [:<> \"Similar for third derivative\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dr397Let29CiJBK6aqaxkdCyZ7GrQ\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(defn xsinx''' [x] (- (* -3.0 (m/sin x))\\n                   (* x (m/cos x))))\", :nextjournal/render-opts {:loc {:line 216, :end-line 218, :column 1, :end-column 37}, :id \"calculus/xsinx'''-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value \"(xsinx''' 0.5)\", :nextjournal/render-opts {:loc {:line 220, :end-line 220, :column 1, :end-column 15}, :id \"calculus/anon-expr-5dsun2gV5XpRZxTFoB7kN7qovEuGKS-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value -1.8770678967577952, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dsun2gV5XpRZxTFoB7kN7qovEuGKS-result\"}}, :nextjournal/blob-id \"5drs3q5BHvYVwjU8dXgkGB3RvdhC2h\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dsun2gV5XpRZxTFoB7kN7qovEuGKS-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value \"(def xsinx-diff-3 (calc/derivative xsinx 3))\", :nextjournal/render-opts {:loc {:line 222, :end-line 223, :column 1, :end-column 45}, :id \"calculus/xsinx-diff-3-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value \"(xsinx-diff-3 0.5)\", :nextjournal/render-opts {:loc {:line 225, :end-line 225, :column 1, :end-column 19}, :id \"calculus/anon-expr-5dtvLrz7ppAAQqferBZU1f1txWJbbz-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value -1.8770678338087599, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dtvLrz7ppAAQqferBZU1f1txWJbbz-result\"}}, :nextjournal/blob-id \"5ds8ojgRWebwN9Zmxjaun3c2z42E34\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dtvLrz7ppAAQqferBZU1f1txWJbbz-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value \"accuracy\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 1], :nextjournal/value \"method\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 2], :nextjournal/value \"extrapolation?\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 3], :nextjournal/value \"f'''(0.5)\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 4], :nextjournal/value \"error\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-head-viewer, :render-fn #viewer-fn (fn [header-row {:as opts, :keys [path number-col?]}] [:thead (into [:tr] (map-indexed (fn [i {:as header-cell, :nextjournal/keys [value]}] (let [title (when (or (string? value) (keyword? value) (symbol? value)) value)] [:th.pl-6.pr-2.py-1.align-bottom.font-medium.top-0.z-10.bg-white.dark:bg-slate-900.border-b.border-gray-300.dark:border-slate-700 (cond-> {:class (when (and (ifn? number-col?) (number-col? i)) \"text-right\")} title (assoc :title title)) (nextjournal.clerk.render/inspect-presented opts header-cell)]))) header-row)]), :hash \"5dsuyZRvJwykvdxHCRoj1p24Ru4wYR\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value [{:path [1 0 0], :nextjournal/value 2, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 0 1], :nextjournal/value :forward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 0 2], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 0 3], :nextjournal/value -1.877067989475331, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 0 4], :nextjournal/value 9.271753587114517E-8, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 1], :nextjournal/value [{:path [1 1 0], :nextjournal/value 2, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 1 1], :nextjournal/value :forward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 1 2], :nextjournal/value true, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 1 3], :nextjournal/value -1.877067938216127, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 1 4], :nextjournal/value 4.1458331878629906E-8, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 2], :nextjournal/value [{:path [1 2 0], :nextjournal/value 2, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 2 1], :nextjournal/value :backward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 2 2], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 2 3], :nextjournal/value -1.8770686121416162, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 2 4], :nextjournal/value 7.153838210705032E-7, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 3], :nextjournal/value [{:path [1 3 0], :nextjournal/value 2, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 3 1], :nextjournal/value :backward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 3 2], :nextjournal/value true, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 3 3], :nextjournal/value -1.8770679619725656, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 3 4], :nextjournal/value 6.521477047272128E-8, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 4], :nextjournal/value [{:path [1 4 0], :nextjournal/value 2, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 4 1], :nextjournal/value :central, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 4 2], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 4 3], :nextjournal/value -1.8770678338087599, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 4 4], :nextjournal/value 6.294903531767204E-8, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 5], :nextjournal/value [{:path [1 5 0], :nextjournal/value 2, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 5 1], :nextjournal/value :central, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 5 2], :nextjournal/value true, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 5 3], :nextjournal/value -1.8770678967814811, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 5 4], :nextjournal/value 2.368594209656294E-11, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 6], :nextjournal/value [{:path [1 6 0], :nextjournal/value 4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 6 1], :nextjournal/value :forward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 6 2], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 6 3], :nextjournal/value -1.8770366486056522, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 6 4], :nextjournal/value 3.1248152142948626E-5, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 7], :nextjournal/value [{:path [1 7 0], :nextjournal/value 4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 7 1], :nextjournal/value :forward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 7 2], :nextjournal/value true, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 7 3], :nextjournal/value -1.8770679202172493, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 7 4], :nextjournal/value 2.3459454157048754E-8, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 8], :nextjournal/value [{:path [1 8 0], :nextjournal/value 4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 8 1], :nextjournal/value :backward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 8 2], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 8 3], :nextjournal/value -1.8770748388044662, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 8 4], :nextjournal/value 6.9420466710656825E-6, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 9], :nextjournal/value [{:path [1 9 0], :nextjournal/value 4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 9 1], :nextjournal/value :backward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 9 2], :nextjournal/value true, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 9 3], :nextjournal/value -1.8770680860616267, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 9 4], :nextjournal/value 1.8930383149928787E-7, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 10], :nextjournal/value [{:path [1 10 0], :nextjournal/value 4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 10 1], :nextjournal/value :central, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 10 2], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 10 3], :nextjournal/value -1.8770681062252597, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 10 4], :nextjournal/value 2.094674644848027E-7, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 11], :nextjournal/value [{:path [1 11 0], :nextjournal/value 4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 11 1], :nextjournal/value :central, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 11 2], :nextjournal/value true, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 11 3], :nextjournal/value -1.87706789679577, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 11 4], :nextjournal/value 3.797473446809363E-11, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 12], :nextjournal/value [{:path [1 12 0], :nextjournal/value 6, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 12 1], :nextjournal/value :forward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 12 2], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 12 3], :nextjournal/value -1.8769667024263026, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 12 4], :nextjournal/value 1.0119433149258228E-4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 13], :nextjournal/value [{:path [1 13 0], :nextjournal/value 6, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 13 1], :nextjournal/value :forward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 13 2], :nextjournal/value true, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 13 3], :nextjournal/value -1.8770676421190913, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 13 4], :nextjournal/value 2.5463870390041166E-7, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 14], :nextjournal/value [{:path [1 14 0], :nextjournal/value 6, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 14 1], :nextjournal/value :backward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 14 2], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 14 3], :nextjournal/value -1.877076499247893, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 14 4], :nextjournal/value 8.602490097819881E-6, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 15], :nextjournal/value [{:path [1 15 0], :nextjournal/value 6, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 15 1], :nextjournal/value :backward, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 15 2], :nextjournal/value true, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 15 3], :nextjournal/value -1.8770679013832705, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 15 4], :nextjournal/value 4.6254753360841505E-9, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 16], :nextjournal/value [{:path [1 16 0], :nextjournal/value 6, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 16 1], :nextjournal/value :central, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 16 2], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 16 3], :nextjournal/value -1.877072072479773, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 16 4], :nextjournal/value 4.175721977750513E-6, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 17], :nextjournal/value [{:path [1 17 0], :nextjournal/value 6, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 17 1], :nextjournal/value :central, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 17 2], :nextjournal/value true, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}} {:path [1 17 3], :nextjournal/value -1.8770678971522183, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 17 4], :nextjournal/value 3.944231607988513E-10, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-body-viewer, :render-fn #viewer-fn (fn [rows opts] (into [:tbody] (map-indexed (fn [idx row] (nextjournal.clerk.render/inspect-presented (update opts :path conj idx) row))) rows)), :hash \"5dsefivD6wgJ7qkFYswJThKvfZ3x3P\"}}], :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 5, :number-col? #{0 4 3}, :id \"calculus/anon-expr-5duE8J3oiu4vHpnuE1KfsRigdPfuwQ-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/table-markup-viewer, :render-fn #viewer-fn (fn [head+body opts] [:div (into [nextjournal.clerk.render/render-table-with-sticky-header] (nextjournal.clerk.render/inspect-children opts) head+body)]), :hash \"5drXFLdHZgfgZHMAR1nVZrHeF8oNVJ\"}}, :nextjournal/blob-id \"5du4B8fVkdEEBCBaEPBX1YsMmbjTYP\"}, :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 5, :number-col? #{0 4 3}, :id \"calculus/anon-expr-5duE8J3oiu4vHpnuE1KfsRigdPfuwQ-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5drDRxMzMcRmdfhpLmS9MAug4AM9Eg\"} [\"h3\" {:id \"gradient-and-hessian\"} [:<> \"Gradient and Hessian\"]] [:p [:<> \"For multivariate real-valued function there are two functions: \"] [:code [:<> \"gradient\"]] [:<> \" and \"] [:code [:<> \"hessian\"]] [:<> \". Both functions accept \"] [:code [:<> \":h\"]] [:<> \" option, \"] [:code [:<> \"gradient\"]] [:<> \" also \"] [:code [:<> \":acc\"]] [:<> \" (2 or 4).\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5drDRxMzMcRmdfhpLmS9MAug4AM9Eg\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value \"symbol\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 1], :nextjournal/value \"info\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-head-viewer, :render-fn #viewer-fn (fn [header-row {:as opts, :keys [path number-col?]}] [:thead (into [:tr] (map-indexed (fn [i {:as header-cell, :nextjournal/keys [value]}] (let [title (when (or (string? value) (keyword? value) (symbol? value)) value)] [:th.pl-6.pr-2.py-1.align-bottom.font-medium.top-0.z-10.bg-white.dark:bg-slate-900.border-b.border-gray-300.dark:border-slate-700 (cond-> {:class (when (and (ifn? number-col?) (number-col? i)) \"text-right\")} title (assoc :title title)) (nextjournal.clerk.render/inspect-presented opts header-cell)]))) header-row)]), :hash \"5dsuyZRvJwykvdxHCRoj1p24Ru4wYR\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value [{:path [1 0 0], :nextjournal/value \"gradient\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}} {:path [1 0 1], :nextjournal/value \"first partial derivatives, returns vector\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 1], :nextjournal/value [{:path [1 1 0], :nextjournal/value \"hessian\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}} {:path [1 1 1], :nextjournal/value \"second partial derivatives, returns vector of vectors\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-body-viewer, :render-fn #viewer-fn (fn [rows opts] (into [:tbody] (map-indexed (fn [idx row] (nextjournal.clerk.render/inspect-presented (update opts :path conj idx) row))) rows)), :hash \"5dsefivD6wgJ7qkFYswJThKvfZ3x3P\"}}], :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 2, :number-col? #{}, :id \"calculus/anon-expr-5drf3aT539zPV5fK7kMkTNGskuVsZS-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/table-markup-viewer, :render-fn #viewer-fn (fn [head+body opts] [:div (into [nextjournal.clerk.render/render-table-with-sticky-header] (nextjournal.clerk.render/inspect-children opts) head+body)]), :hash \"5drXFLdHZgfgZHMAR1nVZrHeF8oNVJ\"}}, :nextjournal/blob-id \"5dtZKHHcFCeuLKjz39RW4AZd1t3LPs\"}, :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 2, :number-col? #{}, :id \"calculus/anon-expr-5drf3aT539zPV5fK7kMkTNGskuVsZS-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dtLDSBNn7yWkkkU3w51k1Wf9ii2jP\"} [:p [:<> \"Let's define multivariate function x2siny\"]] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"f(x,y) = x^2\\\\sin{y}\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"\\\\nabla f = \\\\left(2x\\\\sin{y}, x^2\\\\cos{y} \\\\right)\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"Hf = \\\\begin{bmatrix}\\n   2\\\\sin{y} & 2x\\\\cos{y} \\\\\\\\\\n   2x\\\\cos{y} & -x^2\\\\sin{y}\\n \\\\end{bmatrix}\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}]], :nextjournal/render-opts {:id \"calculus/markdown-5dtLDSBNn7yWkkkU3w51k1Wf9ii2jP\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(defn x2siny [[x y]] (* x x (m/sin y)))\", :nextjournal/render-opts {:loc {:line 258, :end-line 259, :column 1, :end-column 40}, :id \"calculus/x2siny-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value \"(defn x2siny' [[x y]] [(* 2 x (m/sin y))\\n                    (* x x (m/cos y))])\", :nextjournal/render-opts {:loc {:line 260, :end-line 262, :column 1, :end-column 40}, :id \"calculus/x2siny'-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value \"(defn x2siny'' [[x y]] [[(* 2 (m/sin y)) (* 2 x (m/cos y))]\\n                     [(* 2 x (m/cos y)) (* -1 x x (m/sin y))]])\", :nextjournal/render-opts {:loc {:line 263, :end-line 265, :column 1, :end-column 64}, :id \"calculus/x2siny''-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value \"(def x2siny-fd' (calc/gradient x2siny))\", :nextjournal/render-opts {:loc {:line 267, :end-line 268, :column 1, :end-column 40}, :id \"calculus/x2siny-fd'-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value \"(def x2siny-fd'' (calc/hessian x2siny {:h 1.0e-4}))\", :nextjournal/render-opts {:loc {:line 269, :end-line 270, :column 1, :end-column 52}, :id \"calculus/x2siny-fd''-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5drWV8sTvvZFHe7jDCeRZ32L2VazWG\"} [:p [:<> \"Values of gradient and hessian evaluated at \"] [:code [:<> \"[1,2]\"]]]], :nextjournal/render-opts {:id \"calculus/markdown-5drWV8sTvvZFHe7jDCeRZ32L2VazWG\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value \"method\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 1], :nextjournal/value \"gradient\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 2], :nextjournal/value \"hessian\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-head-viewer, :render-fn #viewer-fn (fn [header-row {:as opts, :keys [path number-col?]}] [:thead (into [:tr] (map-indexed (fn [i {:as header-cell, :nextjournal/keys [value]}] (let [title (when (or (string? value) (keyword? value) (symbol? value)) value)] [:th.pl-6.pr-2.py-1.align-bottom.font-medium.top-0.z-10.bg-white.dark:bg-slate-900.border-b.border-gray-300.dark:border-slate-700 (cond-> {:class (when (and (ifn? number-col?) (number-col? i)) \"text-right\")} title (assoc :title title)) (nextjournal.clerk.render/inspect-presented opts header-cell)]))) header-row)]), :hash \"5dsuyZRvJwykvdxHCRoj1p24Ru4wYR\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value [{:path [1 0 0], :nextjournal/value \"actual\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [1 0 1], :nextjournal/value [{:path [1 0 1 0], :nextjournal/value 1.8185948536513636, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 0 1 1], :nextjournal/value -0.4161468365471422, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/vector-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-coll, :opening-paren \"[\", :closing-paren (\"]\"), :page-size 20, :hash \"5dsD1KJESfc8Dy8gPeGQfZCX2ayE8f\"}} {:path [1 0 2], :nextjournal/value [{:path [1 0 2 0], :nextjournal/value [{:path [1 0 2 0 0], :nextjournal/value 1.8185948536513636, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 0 2 0 1], :nextjournal/value -0.8322936730942844, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/vector-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-coll, :opening-paren \"[\", :closing-paren (\"]\"), :page-size 20, :hash \"5dsD1KJESfc8Dy8gPeGQfZCX2ayE8f\"}} {:path [1 0 2 1], :nextjournal/value [{:path [1 0 2 1 0], :nextjournal/value -0.8322936730942844, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 0 2 1 1], :nextjournal/value -0.9092974268256818, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/vector-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-coll, :opening-paren \"[\", :closing-paren (\"]\" \"]\"), :page-size 20, :hash \"5dsD1KJESfc8Dy8gPeGQfZCX2ayE8f\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/vector-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-coll, :opening-paren \"[\", :page-size 20, :hash \"5dsD1KJESfc8Dy8gPeGQfZCX2ayE8f\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 1], :nextjournal/value [{:path [1 1 0], :nextjournal/value \"finite difference\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [1 1 1], :nextjournal/value [{:path [1 1 1 0], :nextjournal/value 1.8185948536530994, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 1 1 1], :nextjournal/value -0.41614683654600526, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/sequential-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-coll, :opening-paren \"(\", :closing-paren (\")\"), :page-size 20, :hash \"5dsgY1QgV2KqnvvrRRC3HXgCeF3Qge\"}} {:path [1 1 2], :nextjournal/value [{:path [1 1 2 0], :nextjournal/value [{:path [1 1 2 0 0], :nextjournal/value 1.8185948524873652, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 1 2 0 1], :nextjournal/value -0.8322936728699659, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/sequential-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-coll, :opening-paren \"(\", :closing-paren (\")\"), :page-size 20, :hash \"5dsgY1QgV2KqnvvrRRC3HXgCeF3Qge\"}} {:path [1 1 2 1], :nextjournal/value [{:path [1 1 2 1 0], :nextjournal/value -0.8322936728699659, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 1 2 1 1], :nextjournal/value -0.9092974373459128, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/sequential-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-coll, :opening-paren \"(\", :closing-paren (\")\" \")\"), :page-size 20, :hash \"5dsgY1QgV2KqnvvrRRC3HXgCeF3Qge\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/sequential-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-coll, :opening-paren \"(\", :page-size 20, :hash \"5dsgY1QgV2KqnvvrRRC3HXgCeF3Qge\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-body-viewer, :render-fn #viewer-fn (fn [rows opts] (into [:tbody] (map-indexed (fn [idx row] (nextjournal.clerk.render/inspect-presented (update opts :path conj idx) row))) rows)), :hash \"5dsefivD6wgJ7qkFYswJThKvfZ3x3P\"}}], :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 3, :number-col? #{}, :auto-expand-results? true, :id \"calculus/anon-expr-5dqs1ZLiJVVeVSuVWgq5ftRvYWq3ch-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/table-markup-viewer, :render-fn #viewer-fn (fn [head+body opts] [:div (into [nextjournal.clerk.render/render-table-with-sticky-header] (nextjournal.clerk.render/inspect-children opts) head+body)]), :hash \"5drXFLdHZgfgZHMAR1nVZrHeF8oNVJ\"}}, :nextjournal/blob-id \"5dsxPgwzFRaVMnfGuLVkLaf2iJFYLz\"}, :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 3, :number-col? #{}, :auto-expand-results? true, :id \"calculus/anon-expr-5dqs1ZLiJVVeVSuVWgq5ftRvYWq3ch-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5drjmT8kaWs8vUaSuEjgpSbV7Gg1W9\"} [\"h2\" {:id \"integration\"} [:<> \"Integration\"]] [:p [:<> \"Univariate \"] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"R\\\\to R\", :nextjournal/viewer {:name :nextjournal.markdown/formula, :render-fn #viewer-fn (fn [tex] (nextjournal.clerk.render/render-katex tex {:inline? true})), :hash \"5dtTBivp9Yiw7XSqxv1opZHNencsu6\"}}] [:<> \" and multivariate \"] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"R^n\\\\to R\", :nextjournal/viewer {:name :nextjournal.markdown/formula, :render-fn #viewer-fn (fn [tex] (nextjournal.clerk.render/render-katex tex {:inline? true})), :hash \"5dtTBivp9Yiw7XSqxv1opZHNencsu6\"}}] [:<> \" functions can be integrated.\"]] [:p [:<> \"Improper integrals are automatically handled and substituted in the following way.\"]] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"\\\\int\\\\limits_{-\\\\infty}^a f(x)\\\\,dx = \\\\int\\\\limits_{-1}^0 \\\\frac{1}{(1+t)^2} f\\\\left(a+\\\\frac{t}{1+t}\\\\right)\\\\,dt\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"\\\\int\\\\limits_a^\\\\infty f(x)\\\\,dx = \\\\int\\\\limits_0^1 \\\\frac{1}{(1-t)^2} f\\\\left(a+\\\\frac{t}{1-t}\\\\right)\\\\,dt\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"\\\\int\\\\limits_{-\\\\infty}^\\\\infty f(x)\\\\,dx = \\\\int\\\\limits_{-1}^1 \\\\frac{1+t^2}{(1-t^2)^2} f\\\\left(\\\\frac{t}{1-t^2}\\\\right)\\\\,dt\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}] [:p [:<> \"The same applies for multivariate case.\"]] [\"h3\" {:id \"univariate\"} [:<> \"Univariate\"]] [:p [:<> \"Integration of \"] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"f: R\\\\to R\", :nextjournal/viewer {:name :nextjournal.markdown/formula, :render-fn #viewer-fn (fn [tex] (nextjournal.clerk.render/render-katex tex {:inline? true})), :hash \"5dtTBivp9Yiw7XSqxv1opZHNencsu6\"}}] [:<> \" functions.\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5drjmT8kaWs8vUaSuEjgpSbV7Gg1W9\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value \"symbol\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 1], :nextjournal/value \"info\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-head-viewer, :render-fn #viewer-fn (fn [header-row {:as opts, :keys [path number-col?]}] [:thead (into [:tr] (map-indexed (fn [i {:as header-cell, :nextjournal/keys [value]}] (let [title (when (or (string? value) (keyword? value) (symbol? value)) value)] [:th.pl-6.pr-2.py-1.align-bottom.font-medium.top-0.z-10.bg-white.dark:bg-slate-900.border-b.border-gray-300.dark:border-slate-700 (cond-> {:class (when (and (ifn? number-col?) (number-col? i)) \"text-right\")} title (assoc :title title)) (nextjournal.clerk.render/inspect-presented opts header-cell)]))) header-row)]), :hash \"5dsuyZRvJwykvdxHCRoj1p24Ru4wYR\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value [{:path [1 0 0], :nextjournal/value \"integate\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}} {:path [1 0 1], :nextjournal/value \"Integrate univariate function\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-body-viewer, :render-fn #viewer-fn (fn [rows opts] (into [:tbody] (map-indexed (fn [idx row] (nextjournal.clerk.render/inspect-presented (update opts :path conj idx) row))) rows)), :hash \"5dsefivD6wgJ7qkFYswJThKvfZ3x3P\"}}], :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 2, :number-col? #{}, :id \"calculus/anon-expr-5drbHbLupyd2irsKVBuZvgaJoAz88L-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/table-markup-viewer, :render-fn #viewer-fn (fn [head+body opts] [:div (into [nextjournal.clerk.render/render-table-with-sticky-header] (nextjournal.clerk.render/inspect-children opts) head+body)]), :hash \"5drXFLdHZgfgZHMAR1nVZrHeF8oNVJ\"}}, :nextjournal/blob-id \"5duLvq4Qa614hqJZoWdJPbBgA12ps5\"}, :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 2, :number-col? #{}, :id \"calculus/anon-expr-5drbHbLupyd2irsKVBuZvgaJoAz88L-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5ds2GMd5CNbH6kYkfDmNkKbLsbsDgG\"} [:p [:code [:<> \"integrate\"]] [:<> \" accepts function, lower and upper bound and the following options:\"]] [:ul [:li [:<> [:code [:<> \":integrator\"]] [:<> \" - integration algorithm, one of: \"] [:code [:<> \":romberg\"]] [:<> \", \"] [:code [:<> \":trapezoid\"]] [:<> \", \"] [:code [:<> \":midpoint\"]] [:<> \", \"] [:code [:<> \":simpson\"]] [:<> \", \"] [:code [:<> \":gauss-legendre\"]] [:<> \" and \"] [:code [:<> \":gauss-kronrod\"]] [:<> \" (default).\"]]] [:li [:<> [:code [:<> \":min-iters\"]] [:<> \" - minimum number of iterations (default: 3), not used in \"] [:code [:<> \":gauss-kronrod\"]]]] [:li [:<> [:code [:<> \":max-iters\"]] [:<> \" - maximum number of iterations (default: 32 or 64)\"]]] [:li [:<> [:code [:<> \":max-evals\"]] [:<> \" - maximum number of evaluations, (default: maximum integer)\"]]] [:li [:<> [:code [:<> \":rel\"]] [:<> \" - relative error\"]]] [:li [:<> [:code [:<> \":abs\"]] [:<> \" - absolute error\"]]] [:li [:<> [:code [:<> \":integration-points\"]] [:<> \" - number of integration (quadrature) points for \"] [:code [:<> \":gauss-legendre\"]] [:<> \" and \"] [:code [:<> \":gauss-kronrod\"]] [:<> \", default 7\"]]] [:li [:<> [:code [:<> \":initdiv\"]] [:<> \" - initial number of subdivisions for \"] [:code [:<> \":gauss-kronrod\"]] [:<> \", default: 1\"]]] [:li [:<> [:code [:<> \":info?\"]] [:<> \" - return full information about integration, default: false\"]]]] [:p [:code [:<> \":gauss-kronrod\"]] [:<> \" is a h-adaptive implementation based on \"] [:a {:href \"https://juliamath.github.io/QuadGK.jl/stable/\"} [:<> \"QuadGK.jl\"]]] [\"h4\" {:id \"examples\"} [:<> \"Examples\"]] [:p [:<> \"First function will is the following:\"]] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"f_1(x) = \\\\frac{\\\\ln(1-x)}{x}\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}]], :nextjournal/render-opts {:id \"calculus/markdown-5ds2GMd5CNbH6kYkfDmNkKbLsbsDgG\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(defn f1 ^double [^double x] (/ (m/ln (- 1.0 x)) x))\", :nextjournal/render-opts {:loc {:line 322, :end-line 322, :column 1, :end-column 53}, :id \"calculus/f1-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value \"#function[calculus/f1]\", :nextjournal/viewer {:name nextjournal.clerk.viewer/read+inspect-viewer, :render-fn #viewer-fn (fn [x] (try [nextjournal.clerk.render/inspect (nextjournal.clerk.viewer/read-string-without-tag-table x)] (catch js/Error _e (nextjournal.clerk.render/render-unreadable-edn x)))), :hash \"5draK8r6Qh96paK7hAAz4TKbfdrpV4\"}, :nextjournal/render-opts {:id \"calculus/f1-result\"}}, :nextjournal/blob-id nil}, :nextjournal/render-opts {:id \"calculus/f1-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dsDUsot2TVgrxJzxkjrBmXLsiw5Fi\"} [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"\\\\int\\\\limits_0^1 f_1(x)\\\\,dx = -\\\\frac{\\\\pi^2}{6} \\\\approx -1.6449341\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}]], :nextjournal/render-opts {:id \"calculus/markdown-5dsDUsot2TVgrxJzxkjrBmXLsiw5Fi\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(/ (m/sq m/PI) -6.0)\", :nextjournal/render-opts {:loc {:line 326, :end-line 326, :column 1, :end-column 21}, :id \"calculus/anon-expr-5dtrPCdkrrDLoAQMn77h53AvFVHQ8n-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value -1.6449340668482264, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dtrPCdkrrDLoAQMn77h53AvFVHQ8n-result\"}}, :nextjournal/blob-id \"5ds19gAoqou3ME9XcrHVjPkM9b9hYq\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dtrPCdkrrDLoAQMn77h53AvFVHQ8n-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dswSzPG9sHGgq3REKrDHFcL5fPe56\"} [:p [:<> \"Default, Gauss-Kronrod quadrature is used, the other integrators fail.\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dswSzPG9sHGgq3REKrDHFcL5fPe56\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(calc/integrate f1 0.0 1.0 {:max-iters 100000\\n                            :integration-points 64\\n                            :info? true\\n                            :abs 1.0e-8\\n                            :rel 0})\", :nextjournal/render-opts {:loc {:line 330, :end-line 335, :column 1, :end-column 37}, :id \"calculus/anon-expr-5drBM2cds3ik6f9bjahTPQwVfecpBw-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value :error, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [0 1], :nextjournal/value 7.880804531255458E-9, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value :evaluations, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 1], :nextjournal/value 4227072, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [2], :nextjournal/value [{:path [2 0], :nextjournal/value :fail?, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [2 1], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [3], :nextjournal/value [{:path [3 0], :nextjournal/value :iterations, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [3 1], :nextjournal/value 16384, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [4], :nextjournal/value [{:path [4 0], :nextjournal/value :result, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [4 1], :nextjournal/value -1.6449340654655928, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [5], :nextjournal/value [{:path [5 0], :nextjournal/value :subdivisions, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [5 1], :nextjournal/value 16384, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-map, :opening-paren \"{\", :closing-paren (\"}\"), :page-size 10, :hash \"5drc3ac5ux7kS4h2vozdxwsrKDqSmn\"}, :nextjournal/render-opts {:auto-expand-results? true, :id \"calculus/anon-expr-5drBM2cds3ik6f9bjahTPQwVfecpBw-result\"}}, :nextjournal/blob-id \"5dtYBGbDa9hLARHJmvyuGy5PKbBF8R\"}, :nextjournal/render-opts {:auto-expand-results? true, :id \"calculus/anon-expr-5drBM2cds3ik6f9bjahTPQwVfecpBw-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dqqJY5rbkXuZWDRkVSdzd5zCk5XQt\"} [:p [:<> \"Another case is the following:\"]] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"f_2(x) =  \\\\frac{e^{-x^2} - e^{-x}}{x}\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}]], :nextjournal/render-opts {:id \"calculus/markdown-5dqqJY5rbkXuZWDRkVSdzd5zCk5XQt\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(defn f2 ^double [^double x] (/ (- (m/exp (- (m/sq x)))\\n                                (m/exp (- x))) x))\", :nextjournal/render-opts {:loc {:line 341, :end-line 342, :column 1, :end-column 51}, :id \"calculus/f2-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value \"#function[calculus/f2]\", :nextjournal/viewer {:name nextjournal.clerk.viewer/read+inspect-viewer, :render-fn #viewer-fn (fn [x] (try [nextjournal.clerk.render/inspect (nextjournal.clerk.viewer/read-string-without-tag-table x)] (catch js/Error _e (nextjournal.clerk.render/render-unreadable-edn x)))), :hash \"5draK8r6Qh96paK7hAAz4TKbfdrpV4\"}, :nextjournal/render-opts {:id \"calculus/f2-result\"}}, :nextjournal/blob-id nil}, :nextjournal/render-opts {:id \"calculus/f2-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5drHfNmCKpcAAbMR94y6LwWBnLop84\"} [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"\\\\int\\\\limits_0^\\\\infty f_2(x)\\\\,dx = \\\\frac{\\\\gamma}{2} \\\\approx 0.2886078\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}]], :nextjournal/render-opts {:id \"calculus/markdown-5drHfNmCKpcAAbMR94y6LwWBnLop84\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(/ m/GAMMA 2)\", :nextjournal/render-opts {:loc {:line 346, :end-line 346, :column 1, :end-column 14}, :id \"calculus/anon-expr-5dtrYywt9P8Mbk64LW41BMkwWoxy1H-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value 0.28860783245076643, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dtrYywt9P8Mbk64LW41BMkwWoxy1H-result\"}}, :nextjournal/blob-id \"5dsVduhwdgGtE7HTpQWiMoUrNdQoRF\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dtrYywt9P8Mbk64LW41BMkwWoxy1H-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dsiUzmdLc1MEwuQgkkavTDSETRZ6s\"} [:p [:<> \"Most of the algorithms fail, only \"] [:code [:<> \":midpoint\"]] [:<> \" and quadrature based algorithms work.\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dsiUzmdLc1MEwuQgkkavTDSETRZ6s\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value \"method\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 1], :nextjournal/value \"result\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 2], :nextjournal/value \"error\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-head-viewer, :render-fn #viewer-fn (fn [header-row {:as opts, :keys [path number-col?]}] [:thead (into [:tr] (map-indexed (fn [i {:as header-cell, :nextjournal/keys [value]}] (let [title (when (or (string? value) (keyword? value) (symbol? value)) value)] [:th.pl-6.pr-2.py-1.align-bottom.font-medium.top-0.z-10.bg-white.dark:bg-slate-900.border-b.border-gray-300.dark:border-slate-700 (cond-> {:class (when (and (ifn? number-col?) (number-col? i)) \"text-right\")} title (assoc :title title)) (nextjournal.clerk.render/inspect-presented opts header-cell)]))) header-row)]), :hash \"5dsuyZRvJwykvdxHCRoj1p24Ru4wYR\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value [{:path [1 0 0], :nextjournal/value :midpoint, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 0 1], :nextjournal/value 0.2886075940321903, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 0 2], :nextjournal/value 2.3841857615947148E-7, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 1], :nextjournal/value [{:path [1 1 0], :nextjournal/value :gauss-kronrod, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 1 1], :nextjournal/value 0.2886078324507874, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 1 2], :nextjournal/value 2.098321516541546E-14, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 2], :nextjournal/value [{:path [1 2 0], :nextjournal/value :gauss-legendre, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 2 1], :nextjournal/value 0.28860791056589263, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 2 2], :nextjournal/value 7.811512620081729E-8, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-body-viewer, :render-fn #viewer-fn (fn [rows opts] (into [:tbody] (map-indexed (fn [idx row] (nextjournal.clerk.render/inspect-presented (update opts :path conj idx) row))) rows)), :hash \"5dsefivD6wgJ7qkFYswJThKvfZ3x3P\"}}], :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 3, :number-col? #{1 2}, :id \"calculus/anon-expr-5dt9JRuLAyYRVu6Tno19MBy7jXwLcn-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/table-markup-viewer, :render-fn #viewer-fn (fn [head+body opts] [:div (into [nextjournal.clerk.render/render-table-with-sticky-header] (nextjournal.clerk.render/inspect-children opts) head+body)]), :hash \"5drXFLdHZgfgZHMAR1nVZrHeF8oNVJ\"}}, :nextjournal/blob-id \"5du8be1Ge1m82z32pKoeQ1t8E8SLfm\"}, :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 3, :number-col? #{1 2}, :id \"calculus/anon-expr-5dt9JRuLAyYRVu6Tno19MBy7jXwLcn-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dsyd7P6e3zbLmeeibqbDgUYo6BnjH\"} [:p [:<> \"To overcome singularity we can slightly modify integral limits, setting next possible double value of \"] [:code [:<> \"0.0\"]] [:<> \".\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dsyd7P6e3zbLmeeibqbDgUYo6BnjH\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(calc/integrate f2 (m/next-double 0.0) ##Inf {:integrator :romberg})\", :nextjournal/render-opts {:loc {:line 359, :end-line 359, :column 1, :end-column 69}, :id \"calculus/anon-expr-5dtSgYDLNWtKwdcoA2YuXVGWVZR7aE-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value 0.2886076872181683, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dtSgYDLNWtKwdcoA2YuXVGWVZR7aE-result\"}}, :nextjournal/blob-id \"5du3M1i1jgjh1hXmXk9H6jjEXzceQp\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dtSgYDLNWtKwdcoA2YuXVGWVZR7aE-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5drHueCu9Huy8FsicBRQ8md9HswEP1\"} [:p [:<> \"The next function is a cosine with high frequency oscillations.\"]] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"f_3(x) = \\\\cos(200x)\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}]], :nextjournal/render-opts {:id \"calculus/markdown-5drHueCu9Huy8FsicBRQ8md9HswEP1\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(defn f3 ^double [^double x] (m/cos (* 200.0 x)))\", :nextjournal/render-opts {:loc {:line 365, :end-line 365, :column 1, :end-column 50}, :id \"calculus/f3-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value \"#function[calculus/f3]\", :nextjournal/viewer {:name nextjournal.clerk.viewer/read+inspect-viewer, :render-fn #viewer-fn (fn [x] (try [nextjournal.clerk.render/inspect (nextjournal.clerk.viewer/read-string-without-tag-table x)] (catch js/Error _e (nextjournal.clerk.render/render-unreadable-edn x)))), :hash \"5draK8r6Qh96paK7hAAz4TKbfdrpV4\"}, :nextjournal/render-opts {:id \"calculus/f3-result\"}}, :nextjournal/blob-id nil}, :nextjournal/render-opts {:id \"calculus/f3-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dsYgyWbndLhZFazQEFbGKc7n6KKfk\"} [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"\\\\int\\\\limits_0^1 f_3(x)\\\\,dx = \\\\frac{\\\\sin(200)}{200} \\\\approx -0.0043665\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}]], :nextjournal/render-opts {:id \"calculus/markdown-5dsYgyWbndLhZFazQEFbGKc7n6KKfk\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(def f3-integral01 (/ (m/sin 200.0) 200.0))\", :nextjournal/render-opts {:loc {:line 369, :end-line 369, :column 1, :end-column 44}, :id \"calculus/f3-integral01-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value -0.0043664864860699735, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/f3-integral01-result\"}}, :nextjournal/blob-id \"5dsKS8ZnwH3nMFoZr2CU6adsKPiPKZ\"}, :nextjournal/render-opts {:id \"calculus/f3-integral01-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dseSR7KGCTh1osTqoUaLJZJtJHthx\"} [:p [:<> \"As you can see some of the algorithms fail giving really wrong result.\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dseSR7KGCTh1osTqoUaLJZJtJHthx\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value \"method\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 1], :nextjournal/value \"result\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 2], :nextjournal/value \"error\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-head-viewer, :render-fn #viewer-fn (fn [header-row {:as opts, :keys [path number-col?]}] [:thead (into [:tr] (map-indexed (fn [i {:as header-cell, :nextjournal/keys [value]}] (let [title (when (or (string? value) (keyword? value) (symbol? value)) value)] [:th.pl-6.pr-2.py-1.align-bottom.font-medium.top-0.z-10.bg-white.dark:bg-slate-900.border-b.border-gray-300.dark:border-slate-700 (cond-> {:class (when (and (ifn? number-col?) (number-col? i)) \"text-right\")} title (assoc :title title)) (nextjournal.clerk.render/inspect-presented opts header-cell)]))) header-row)]), :hash \"5dsuyZRvJwykvdxHCRoj1p24Ru4wYR\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value [{:path [1 0 0], :nextjournal/value :trapezoid, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 0 1], :nextjournal/value -0.004366485638860065, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 0 2], :nextjournal/value 8.472099081308082E-10, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 1], :nextjournal/value [{:path [1 1 0], :nextjournal/value :midpoint, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 1 1], :nextjournal/value -0.004366482947774871, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 1 2], :nextjournal/value 3.5382951022247533E-9, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 2], :nextjournal/value [{:path [1 2 0], :nextjournal/value :romberg, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 2 1], :nextjournal/value 0.8223681763590893, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 2 2], :nextjournal/value 0.8267346628451593, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 3], :nextjournal/value [{:path [1 3 0], :nextjournal/value :simpson, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 3 1], :nextjournal/value 0.8223681816217753, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 3 2], :nextjournal/value 0.8267346681078452, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 4], :nextjournal/value [{:path [1 4 0], :nextjournal/value :gauss-kronrod, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 4 1], :nextjournal/value -0.004366486486070415, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 4 2], :nextjournal/value 4.414871246360974E-16, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 5], :nextjournal/value [{:path [1 5 0], :nextjournal/value :gauss-legendre, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 5 1], :nextjournal/value -0.004366486486077295, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 5 2], :nextjournal/value 7.321400430360114E-15, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-body-viewer, :render-fn #viewer-fn (fn [rows opts] (into [:tbody] (map-indexed (fn [idx row] (nextjournal.clerk.render/inspect-presented (update opts :path conj idx) row))) rows)), :hash \"5dsefivD6wgJ7qkFYswJThKvfZ3x3P\"}}], :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 3, :number-col? #{1 2}, :id \"calculus/anon-expr-5dtRMDs6oqfgTdRY3Yp6y3y9w753Mk-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/table-markup-viewer, :render-fn #viewer-fn (fn [head+body opts] [:div (into [nextjournal.clerk.render/render-table-with-sticky-header] (nextjournal.clerk.render/inspect-children opts) head+body)]), :hash \"5drXFLdHZgfgZHMAR1nVZrHeF8oNVJ\"}}, :nextjournal/blob-id \"5ds3WPLKMUJQ5LiA4QfyxGnxnwgBdN\"}, :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 3, :number-col? #{1 2}, :id \"calculus/anon-expr-5dtRMDs6oqfgTdRY3Yp6y3y9w753Mk-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dto1xfp4h99CW691puJrUHK2MfkwK\"} [:p [:<> \"The last example is to show the ability to use Richardson extrapolation instead of substitution for improper integrals, relying on the following equality:\"]] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"\\\\int\\\\limits_0^\\\\infty f(x)\\\\,dx = \\\\lim_{t\\\\to\\\\infty} \\\\int\\\\limits_0^t f(x)\\\\,dx\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"f_4 = \\\\frac{e^{-x}}{x+1}\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}]], :nextjournal/render-opts {:id \"calculus/markdown-5dto1xfp4h99CW691puJrUHK2MfkwK\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(defn f4 [x] (/ (m/exp (- x)) (inc x)))\", :nextjournal/render-opts {:loc {:line 387, :end-line 387, :column 1, :end-column 40}, :id \"calculus/f4-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value \"#function[calculus/f4]\", :nextjournal/viewer {:name nextjournal.clerk.viewer/read+inspect-viewer, :render-fn #viewer-fn (fn [x] (try [nextjournal.clerk.render/inspect (nextjournal.clerk.viewer/read-string-without-tag-table x)] (catch js/Error _e (nextjournal.clerk.render/render-unreadable-edn x)))), :hash \"5draK8r6Qh96paK7hAAz4TKbfdrpV4\"}, :nextjournal/render-opts {:id \"calculus/f4-result\"}}, :nextjournal/blob-id nil}, :nextjournal/render-opts {:id \"calculus/f4-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value \"(calc/integrate f4 0 ##Inf)\", :nextjournal/render-opts {:loc {:line 389, :end-line 389, :column 1, :end-column 28}, :id \"calculus/anon-expr-5dqrywQ25ngh6qbV1QFN2cK5a3t3NK-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value 0.5963473623231728, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dqrywQ25ngh6qbV1QFN2cK5a3t3NK-result\"}}, :nextjournal/blob-id \"5drgiM8QoSG6myKttft7ygk8iP8CMy\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dqrywQ25ngh6qbV1QFN2cK5a3t3NK-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5drmYWBQZkt9u7sdL4B8o6T9WuRvP9\"} [:p [:<> \"Let's build extrapolation helper\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5drmYWBQZkt9u7sdL4B8o6T9WuRvP9\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(defn f4-extrapolated [x] (calc/integrate f4 0 x))\", :nextjournal/render-opts {:loc {:line 393, :end-line 393, :column 1, :end-column 51}, :id \"calculus/f4-extrapolated-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value \"#function[calculus/f4-extrapolated]\", :nextjournal/viewer {:name nextjournal.clerk.viewer/read+inspect-viewer, :render-fn #viewer-fn (fn [x] (try [nextjournal.clerk.render/inspect (nextjournal.clerk.viewer/read-string-without-tag-table x)] (catch js/Error _e (nextjournal.clerk.render/render-unreadable-edn x)))), :hash \"5draK8r6Qh96paK7hAAz4TKbfdrpV4\"}, :nextjournal/render-opts {:id \"calculus/f4-extrapolated-result\"}}, :nextjournal/blob-id nil}, :nextjournal/render-opts {:id \"calculus/f4-extrapolated-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value \"((calc/extrapolate (calc/fx->gx+h f4-extrapolated)) ##Inf)\", :nextjournal/render-opts {:loc {:line 395, :end-line 395, :column 1, :end-column 59}, :id \"calculus/anon-expr-5dtpJiAKiL9YR8AWbjvratYR3XFxqn-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value 0.5963473623231945, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dtpJiAKiL9YR8AWbjvratYR3XFxqn-result\"}}, :nextjournal/blob-id \"5dr8xSdVR3Bd6wf49CkdFtfT6Ngyap\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dtpJiAKiL9YR8AWbjvratYR3XFxqn-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dqwMXLS3uKzEvcvwECkceg9qe4oFT\"} [\"h3\" {:id \"multivariate\"} [:<> \"Multivariate\"]] [:p [:<> \"There are two algorithms to calculate an integral of multivariate function. Both methods accept function (with one, vector, argument), lower and upper bounds and options. Integration can be indefinite.\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dqwMXLS3uKzEvcvwECkceg9qe4oFT\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value \"symbol\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 1], :nextjournal/value \"info\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-head-viewer, :render-fn #viewer-fn (fn [header-row {:as opts, :keys [path number-col?]}] [:thead (into [:tr] (map-indexed (fn [i {:as header-cell, :nextjournal/keys [value]}] (let [title (when (or (string? value) (keyword? value) (symbol? value)) value)] [:th.pl-6.pr-2.py-1.align-bottom.font-medium.top-0.z-10.bg-white.dark:bg-slate-900.border-b.border-gray-300.dark:border-slate-700 (cond-> {:class (when (and (ifn? number-col?) (number-col? i)) \"text-right\")} title (assoc :title title)) (nextjournal.clerk.render/inspect-presented opts header-cell)]))) header-row)]), :hash \"5dsuyZRvJwykvdxHCRoj1p24Ru4wYR\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value [{:path [1 0 0], :nextjournal/value \"cubature\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}} {:path [1 0 1], :nextjournal/value \"h-adaptive multi-dimensional integration, based on Genz-Malik algorithm\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 1], :nextjournal/value [{:path [1 1 0], :nextjournal/value \"vegas\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}} {:path [1 1 1], :nextjournal/value \"VEGAS/VEGAS+ Monte-Carlo integration\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-body-viewer, :render-fn #viewer-fn (fn [rows opts] (into [:tbody] (map-indexed (fn [idx row] (nextjournal.clerk.render/inspect-presented (update opts :path conj idx) row))) rows)), :hash \"5dsefivD6wgJ7qkFYswJThKvfZ3x3P\"}}], :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 2, :number-col? #{}, :id \"calculus/anon-expr-5dtfi3y1yBKqCGJty86bVSSNiQx3Fk-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/table-markup-viewer, :render-fn #viewer-fn (fn [head+body opts] [:div (into [nextjournal.clerk.render/render-table-with-sticky-header] (nextjournal.clerk.render/inspect-children opts) head+body)]), :hash \"5drXFLdHZgfgZHMAR1nVZrHeF8oNVJ\"}}, :nextjournal/blob-id \"5drkPdEQsvoaVM8da4M5t5FNrAD6e8\"}, :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 2, :number-col? #{}, :id \"calculus/anon-expr-5dtfi3y1yBKqCGJty86bVSSNiQx3Fk-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dsRcCsG5AzGUXAX6JDcvnNoYdL7FF\"} [\"h4\" {:id \"cubature\"} [:<> \"Cubature\"]] [:p [:code [:<> \"cubature\"]] [:<> \" is based on algorithm described by \"] [:a {:href \"https://www.sciencedirect.com/science/article/pii/0771050X8090039X\"} [:<> \"A.C.Genz and A.A.Malik\"]] [:<> \" and is a reimplementation of \"] [:a {:href \"https://github.com/JuliaMath/HCubature.jl\"} [:<> \"HCubature.jl package\"]]] [:p [:code [:<> \"cubature\"]] [:<> \" is an iterative and adaptative method which subdivides volume into smaller volumes to increase accuracy.\"]] [:p [:<> \"Options are:\"]] [:ul [:li [:<> [:code [:<> \":initvid\"]] [:<> \" - initial subdivision per dimension, default: 2.\"]]] [:li [:<> [:code [:<> \":max-evals\"]] [:<> \" - maximum number of evaluations, default: max integer value.\"]]] [:li [:<> [:code [:<> \":max-iters\"]] [:<> \" - maximum number of iterations, default: 64.\"]]] [:li [:<> [:code [:<> \":rel\"]] [:<> \" - relative error, 1.0e-7\"]]] [:li [:<> [:code [:<> \":abs\"]] [:<> \" - absolute error, 1.0e-7\"]]] [:li [:<> [:code [:<> \":info?\"]] [:<> \" - return full information about integration, default: false\"]]]] [:p [:<> \"If \"] [:code [:<> \":info?\"]] [:<> \" is set to \"] [:code [:<> \"true\"]] [:<> \", more additional info is returned:\"]] [:ul [:li [:<> [:code [:<> \":result\"]] [:<> \" - integration value\"]]] [:li [:<> [:code [:<> \":error\"]] [:<> \" - integration error\"]]] [:li [:<> [:code [:<> \":iterations\"]] [:<> \" - number of iterations\"]]] [:li [:<> [:code [:<> \":evaluations\"]] [:<> \" - number of evaluations\"]]] [:li [:<> [:code [:<> \":subdivisions\"]] [:<> \" - final number of volumes used in integration\"]]] [:li [:<> [:code [:<> \":fail?\"]] [:<> \" - set to \"] [:code [:<> \":max-evals\"]] [:<> \" or \"] [:code [:<> \":max-iters\"]] [:<> \" when one of the limits has been reached without desired the convergence.\"]]]] [:p [:<> \"As the first example, lets start with a 2d multi-normal distribution. If we integrate a PDF the result should be \"] [:code [:<> \"1.0\"]] [:<> \". We need to highly raise number of iterations to achieve convergence.\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dsRcCsG5AzGUXAX6JDcvnNoYdL7FF\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(def multi-normal (partial r/pdf (r/distribution :multi-normal {:means [-1 1]})))\", :nextjournal/render-opts {:loc {:line 432, :end-line 432, :column 1, :end-column 82}, :id \"calculus/multi-normal-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value \"#function[clojure.core/partial/fn--5908]\", :nextjournal/viewer {:name nextjournal.clerk.viewer/read+inspect-viewer, :render-fn #viewer-fn (fn [x] (try [nextjournal.clerk.render/inspect (nextjournal.clerk.viewer/read-string-without-tag-table x)] (catch js/Error _e (nextjournal.clerk.render/render-unreadable-edn x)))), :hash \"5draK8r6Qh96paK7hAAz4TKbfdrpV4\"}, :nextjournal/render-opts {:id \"calculus/multi-normal-result\"}}, :nextjournal/blob-id nil}, :nextjournal/render-opts {:id \"calculus/multi-normal-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value \"(calc/cubature multi-normal [##-Inf ##-Inf] [##Inf ##Inf] {:info? true :max-iters 10000})\", :nextjournal/render-opts {:loc {:line 434, :end-line 435, :column 1, :end-column 90}, :id \"calculus/anon-expr-5dtxtbMAm5HkzxcsdoPbTihVpfKqcX-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value :error, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [0 1], :nextjournal/value 9.64902853907483E-8, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value :evaluations, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 1], :nextjournal/value 93347, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [2], :nextjournal/value [{:path [2 0], :nextjournal/value :fail?, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [2 1], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [3], :nextjournal/value [{:path [3 0], :nextjournal/value :iterations, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [3 1], :nextjournal/value 5488, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [4], :nextjournal/value [{:path [4 0], :nextjournal/value :result, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [4 1], :nextjournal/value 0.9999999999976381, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [5], :nextjournal/value [{:path [5 0], :nextjournal/value :subdivisions, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [5 1], :nextjournal/value 5491, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-map, :opening-paren \"{\", :closing-paren (\"}\"), :page-size 10, :hash \"5drc3ac5ux7kS4h2vozdxwsrKDqSmn\"}, :nextjournal/render-opts {:auto-expand-results? true, :id \"calculus/anon-expr-5dtxtbMAm5HkzxcsdoPbTihVpfKqcX-result\"}}, :nextjournal/blob-id \"5dqwZufVAZ9Nzpyh1HTMCYx3S5bHWW\"}, :nextjournal/render-opts {:auto-expand-results? true, :id \"calculus/anon-expr-5dtxtbMAm5HkzxcsdoPbTihVpfKqcX-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dqwHiyfkSzw6igkRGNojhsq5tzSe8\"} [:p [:<> \"Another example will be a volume of 3d ball, which is:\"]] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"\\\\int\\\\limits_0^R\\\\int\\\\limits_0^{2\\\\pi}\\\\int\\\\limits_0^\\\\pi r^2\\\\sin\\\\theta\\\\,d\\\\theta d\\\\varphi dr = \\\\frac{4}{3}\\\\pi R^3\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}]], :nextjournal/render-opts {:id \"calculus/markdown-5dqwHiyfkSzw6igkRGNojhsq5tzSe8\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(defn volume-3d-ball-integrant\\n  ^double [[^double theta ^double _phi ^double r]]\\n  (* r r (m/sin theta)))\", :nextjournal/render-opts {:loc {:line 441, :end-line 443, :column 1, :end-column 25}, :id \"calculus/volume-3d-ball-integrant-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value \"#function[calculus/volume-3d-ball-integrant]\", :nextjournal/viewer {:name nextjournal.clerk.viewer/read+inspect-viewer, :render-fn #viewer-fn (fn [x] (try [nextjournal.clerk.render/inspect (nextjournal.clerk.viewer/read-string-without-tag-table x)] (catch js/Error _e (nextjournal.clerk.render/render-unreadable-edn x)))), :hash \"5draK8r6Qh96paK7hAAz4TKbfdrpV4\"}, :nextjournal/render-opts {:id \"calculus/volume-3d-ball-integrant-result\"}}, :nextjournal/blob-id nil}, :nextjournal/render-opts {:id \"calculus/volume-3d-ball-integrant-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value \"(defn volume-3d-ball [R]\\n  (calc/cubature volume-3d-ball-integrant [0 0 0] [m/PI m/TWO_PI R] {:rel 0 :abs 1.0e-10\\n                                                                     :max-iters 1000}))\", :nextjournal/render-opts {:loc {:line 445, :end-line 447, :column 1, :end-column 88}, :id \"calculus/volume-3d-ball-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value \"#function[calculus/volume-3d-ball]\", :nextjournal/viewer {:name nextjournal.clerk.viewer/read+inspect-viewer, :render-fn #viewer-fn (fn [x] (try [nextjournal.clerk.render/inspect (nextjournal.clerk.viewer/read-string-without-tag-table x)] (catch js/Error _e (nextjournal.clerk.render/render-unreadable-edn x)))), :hash \"5draK8r6Qh96paK7hAAz4TKbfdrpV4\"}, :nextjournal/render-opts {:id \"calculus/volume-3d-ball-result\"}}, :nextjournal/blob-id nil}, :nextjournal/render-opts {:id \"calculus/volume-3d-ball-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value \"(volume-3d-ball 1)\", :nextjournal/render-opts {:loc {:line 449, :end-line 449, :column 1, :end-column 19}, :id \"calculus/anon-expr-5dtUzFLrvFG6nb1RK7eKXd2fTFoSVx-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value 4.1887902047863905, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dtUzFLrvFG6nb1RK7eKXd2fTFoSVx-result\"}}, :nextjournal/blob-id \"5dsJqEd6en1Qzormmu81EmEtwFCEEo\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dtUzFLrvFG6nb1RK7eKXd2fTFoSVx-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5drqQThPtP6yWYABBmFEZURRRvtVGr\"} [:p [:<> \"Here are more result for various R compared to the real volume value, ie. \"] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"\\\\frac{4}{3}\\\\pi R^3\", :nextjournal/viewer {:name :nextjournal.markdown/formula, :render-fn #viewer-fn (fn [tex] (nextjournal.clerk.render/render-katex tex {:inline? true})), :hash \"5dtTBivp9Yiw7XSqxv1opZHNencsu6\"}}]]], :nextjournal/render-opts {:id \"calculus/markdown-5drqQThPtP6yWYABBmFEZURRRvtVGr\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value \"R\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 1], :nextjournal/value \"integral\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 2], :nextjournal/value \"expected\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 3], :nextjournal/value \"error\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-head-viewer, :render-fn #viewer-fn (fn [header-row {:as opts, :keys [path number-col?]}] [:thead (into [:tr] (map-indexed (fn [i {:as header-cell, :nextjournal/keys [value]}] (let [title (when (or (string? value) (keyword? value) (symbol? value)) value)] [:th.pl-6.pr-2.py-1.align-bottom.font-medium.top-0.z-10.bg-white.dark:bg-slate-900.border-b.border-gray-300.dark:border-slate-700 (cond-> {:class (when (and (ifn? number-col?) (number-col? i)) \"text-right\")} title (assoc :title title)) (nextjournal.clerk.render/inspect-presented opts header-cell)]))) header-row)]), :hash \"5dsuyZRvJwykvdxHCRoj1p24Ru4wYR\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value [{:path [1 0 0], :nextjournal/value 0.1, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 0 1], :nextjournal/value 0.004188790204789656, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 0 2], :nextjournal/value 0.004188790204786391, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 0 3], :nextjournal/value 3.264749581788351E-15, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 1], :nextjournal/value [{:path [1 1 0], :nextjournal/value 0.5, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 1 1], :nextjournal/value 0.523598775598299, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 1 2], :nextjournal/value 0.5235987755982988, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 1 3], :nextjournal/value 2.220446049250313E-16, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 2], :nextjournal/value [{:path [1 2 0], :nextjournal/value 1.0, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 2 1], :nextjournal/value 4.1887902047863905, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 2 2], :nextjournal/value 4.1887902047863905, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 2 3], :nextjournal/value 0.0, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 3], :nextjournal/value [{:path [1 3 0], :nextjournal/value 2.0, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 3 1], :nextjournal/value 33.51032163829112, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 3 2], :nextjournal/value 33.510321638291124, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 3 3], :nextjournal/value 7.105427357601002E-15, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 4], :nextjournal/value [{:path [1 4 0], :nextjournal/value 5.0, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 4 1], :nextjournal/value 523.5987755982992, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 4 2], :nextjournal/value 523.5987755982989, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 4 3], :nextjournal/value 3.410605131648481E-13, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 5], :nextjournal/value [{:path [1 5 0], :nextjournal/value 20.0, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 5 1], :nextjournal/value 33510.32163829115, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 5 2], :nextjournal/value 33510.32163829113, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 5 3], :nextjournal/value 2.1827872842550278E-11, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-body-viewer, :render-fn #viewer-fn (fn [rows opts] (into [:tbody] (map-indexed (fn [idx row] (nextjournal.clerk.render/inspect-presented (update opts :path conj idx) row))) rows)), :hash \"5dsefivD6wgJ7qkFYswJThKvfZ3x3P\"}}], :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 4, :number-col? #{0 1 3 2}, :id \"calculus/anon-expr-5drN5gg57CMHu2jaax2BATFPU8X5BE-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/table-markup-viewer, :render-fn #viewer-fn (fn [head+body opts] [:div (into [nextjournal.clerk.render/render-table-with-sticky-header] (nextjournal.clerk.render/inspect-children opts) head+body)]), :hash \"5drXFLdHZgfgZHMAR1nVZrHeF8oNVJ\"}}, :nextjournal/blob-id \"5dty8xNy6EYg3n1Tfvgd2mtPTDuyTg\"}, :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 4, :number-col? #{0 1 3 2}, :id \"calculus/anon-expr-5drN5gg57CMHu2jaax2BATFPU8X5BE-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5du3W83v6K6y8PWLG5i46XUAE2tm2z\"} [\"h4\" {:id \"vegas\"} [:<> \"VEGAS\"]] [:p [:a {:href \"https://arxiv.org/abs/2009.05112\"} [:<> \"VEGAS and VEGAS+\"]] [:<> \" are adaptive multidimensional (Quasi) Monte Carlo integration based on adaptive importance and stratified (VEGAS+) sampling.\"]] [:p [:<> \"Options are:\"]] [:ul [:li [:<> [:code [:<> \":max-iters\"]] [:<> \" - maximum number of iterations, default: 10\"]]] [:li [:<> [:code [:<> \":nevals\"]] [:<> \" - number of evaluations per iteration, default: 10000\"]]] [:li [:<> [:code [:<> \":nintervals\"]] [:<> \" - number of grid intervals per dimension (default: 1000)\"]]] [:li [:<> [:code [:<> \":nstrats\"]] [:<> \" - number of stratifications per dimension (calculated if set to \"] [:code [:<> \"-1\"]] [:<> \")\"]]] [:li [:<> [:code [:<> \":warmup\"]] [:<> \" - number of warmup iterations (results are used to train stratification and grid spacings, default: \"] [:code [:<> \"0\"]]]] [:li [:<> [:code [:<> \":alpha\"]] [:<> \" - grid refinement parameter, 0.5 slow (default for vegas+), 1.5 moderate/fast (defatult for vegas)\"]]] [:li [:<> [:code [:<> \":beta\"]] [:<> \" - stratification damping parameter for startification adaptation, default: 0.75\"]]] [:li [:<> [:code [:<> \":rel\"]] [:<> \" - relative accuracy, default: 5.0e-4\"]]] [:li [:<> [:code [:<> \":abs\"]] [:<> \" - absolute accuracy, default: 5.0e-4\"]]] [:li [:<> [:code [:<> \":random-sequence\"]] [:<> \" - random sequence used for generating samples: \"] [:code [:<> \":uniform\"]] [:<> \" (default), low-discrepancy sequences: \"] [:code [:<> \":r2\"]] [:<> \", \"] [:code [:<> \":sobol\"]] [:<> \" and \"] [:code [:<> \":halton\"]] [:<> \".\"]]] [:li [:<> [:code [:<> \":jitter\"]] [:<> \" - jittering factor for low-discrepancy random sequence, default: 0.75\"]]] [:li [:<> [:code [:<> \":info?\"]] [:<> \" - return full information about integration, default: false\"]]] [:li [:<> [:code [:<> \":record-data?\"]] [:<> \" - stores samples, number of strata, x and dx for each iteration, default: false (requires, \"] [:code [:<> \":info?\"]] [:<> \" to be set to \"] [:code [:<> \"true\"]] [:<> \")\"]]]] [:p [:<> \"Function returns a map with following keys (if info? is true, returns result otherwise):\"]] [:ul [:li [:<> [:code [:<> \":result\"]] [:<> \" - value of integral\"]]] [:li [:<> [:code [:<> \":iterations\"]] [:<> \" - number of iterations (excluding warmup)\"]]] [:li [:<> [:code [:<> \":sd\"]] [:<> \" - standard deviation of results\"]]] [:li [:<> [:code [:<> \":nintervals\"]] [:<> \" - actual grid size\"]]] [:li [:<> [:code [:<> \":nstrats\"]] [:<> \" - number of stratitfications per dimension\"]]] [:li [:<> [:code [:<> \":nhcubes\"]] [:<> \" - number of hypercubes\"]]] [:li [:<> [:code [:<> \":evaluations\"]] [:<> \" - number of function calls\"]]] [:li [:<> [:code [:<> \":chi2-avg\"]] [:<> \" - average of chi2\"]]] [:li [:<> [:code [:<> \":dof\"]] [:<> \" - degrees of freedom\"]]] [:li [:<> [:code [:<> \":Q\"]] [:<> \" - goodness of fit indicator, 1 - very good, <0.25 very poor\"]]] [:li [:<> [:code [:<> \":data\"]] [:<> \" - recorded data (if available)\"]]]] [:p [:<> \"Importance and stratified sampling allows algorithm to sample function in regions where the function vary the most. In the following example we'll see how this adaptation is performed.\"]] [:p [:<> \"Original VEGAS used only importance sampling. The options which are used to adjust this part of the algorithm are: \"] [:code [:<> \"nintervals\"]] [:<> \" and \"] [:code [:<> \"alpha\"]] [:<> \". The former sets the size of the grid which is later adjusted to condense sampling in the areas of the highest variation. The latter is responsible for speed of the adjustment (\"] [:code [:<> \"0.5\"]] [:<> \" is quite low, while \"] [:code [:<> \"1.5\"]] [:<> \" is normal). The grid subdivision can be high, by default it's \"] [:code [:<> \"1000\"]] [:<> \".\"]] [:p [:<> \"VEGAS+ add stratified sampling on the top of VEGAS. It splits volume to the number of hypercuebes or hyperrectangles. Each subvolume gets the number of points proportional to the variance of the function values. \"] [:code [:<> \"nstrats\"]] [:<> \" and \"] [:code [:<> \"beta\"]] [:<> \" are options used to control adaptation of the algorithm. \"] [:code [:<> \"nstrats\"]] [:<> \" can be a number or a list of number of strats per dimension (\"] [:code [:<> \"-1\"]] [:<> \" for automatic selection). Set to \"] [:code [:<> \"0\"]] [:<> \" or \"] [:code [:<> \"1\"]] [:<> \" to turn off stratification. \"] [:code [:<> \"beta\"]] [:<> \" controls pace of the adaptation.\"]] [:p [:<> \"Let's illustrate it in the following example. Let's define a function which creates nice shape as a graph (white - near \"] [:code [:<> \"0\"]] [:<> \", dark - the highest value). The function has its highest values near \"] [:code [:<> \"(1.5,0)\"]] [:<> \" and is around \"] [:code [:<> \"2.16\"]] [:<> \":\"]] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"f(x,y)=e^{-2(\\\\cos(y)-\\\\frac{x^2}{2})^2-\\\\cos(x+1)}\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}]], :nextjournal/render-opts {:id \"calculus/markdown-5du3W83v6K6y8PWLG5i46XUAE2tm2z\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(defn func ^double [[^double x ^double y]]\\n  (m/exp (m/- (m/* -2.0 (m/sq (m/- (m/cos y) (m// (m/sq x) 2))))\\n              (m/cos (m/+ 1.0 x)))))\", :nextjournal/render-opts {:loc {:line 505, :end-line 507, :column 1, :end-column 37}, :id \"calculus/func-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value \"#function[calculus/func]\", :nextjournal/viewer {:name nextjournal.clerk.viewer/read+inspect-viewer, :render-fn #viewer-fn (fn [x] (try [nextjournal.clerk.render/inspect (nextjournal.clerk.viewer/read-string-without-tag-table x)] (catch js/Error _e (nextjournal.clerk.render/render-unreadable-edn x)))), :hash \"5draK8r6Qh96paK7hAAz4TKbfdrpV4\"}, :nextjournal/render-opts {:id \"calculus/func-result\"}}, :nextjournal/blob-id nil}, :nextjournal/render-opts {:id \"calculus/func-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/content-type \"image/png\", :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/content-type \"image/png\", :nextjournal/value \"./../../_data/8Vx5nb9YjSjzZof4KhLvbx4HQqyceSMgkFQjxFUj1FB9pL3qFPu1BiF6qexdayM742EcwQQeFcAfMqojFBeSp6Hkvi.png\", :nextjournal/width :wide, :nextjournal/viewer {:name nextjournal.clerk.viewer/image-viewer, :render-fn #viewer-fn (fn [blob-or-url] [:div.flex.flex-col.items-center.not-prose [:img {:src (nextjournal.clerk.render/url-for blob-or-url)}]]), :hash \"5dt7o6hJourKKwffBgPcV6ScgK5Xk7\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dsb4tX6MdeJyPCLKeCj8AsXtmgxgV-result\"}}, :nextjournal/blob-id \"8VvvKoyV9uVRbwqqZYDoHKWRhSc6kCcaRR9sojB4nE29iF7spEidJXnN2xff14bNmdG573LsMwDbaqJLFMYfAsMq9N\"}, :nextjournal/width :wide, :nextjournal/render-opts {:id \"calculus/anon-expr-5dsb4tX6MdeJyPCLKeCj8AsXtmgxgV-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dqpipPZMhtHXPFrMgiJEkr5yMbTNU\"} [:p [:<> \"The value of the integral over \"] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"[-\\\\pi,\\\\pi]\\\\times[-\\\\pi,\\\\pi]\", :nextjournal/viewer {:name :nextjournal.markdown/formula, :render-fn #viewer-fn (fn [tex] (nextjournal.clerk.render/render-katex tex {:inline? true})), :hash \"5dtTBivp9Yiw7XSqxv1opZHNencsu6\"}}] [:<> \" region is:\"]] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"\\\\int\\\\limits_{-\\\\pi}^\\\\pi \\\\int\\\\limits_{-\\\\pi}^\\\\pi e^{-2(\\\\cos(y)-\\\\frac{x^2}{2})^2-\\\\cos(x+1)} \\\\,dx\\\\,dy \\\\approx 8.52775\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}] [:p [:<> \"Cubature algorithm resturns the expected value:\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dqpipPZMhtHXPFrMgiJEkr5yMbTNU\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(calc/cubature func [m/-PI m/-PI] [m/PI m/PI] {:info? true :max-iters 10000})\", :nextjournal/render-opts {:loc {:line 518, :end-line 519, :column 1, :end-column 78}, :id \"calculus/anon-expr-5drDd2LGVKr21767ftpzBhT3dKeikG-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value :error, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [0 1], :nextjournal/value 8.494277705311949E-7, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value :evaluations, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 1], :nextjournal/value 57307, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [2], :nextjournal/value [{:path [2 0], :nextjournal/value :fail?, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [2 1], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [3], :nextjournal/value [{:path [3 0], :nextjournal/value :iterations, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [3 1], :nextjournal/value 3368, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [4], :nextjournal/value [{:path [4 0], :nextjournal/value :result, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [4 1], :nextjournal/value 8.52775226592063, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [5], :nextjournal/value [{:path [5 0], :nextjournal/value :subdivisions, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [5 1], :nextjournal/value 3371, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-map, :opening-paren \"{\", :closing-paren (\"}\"), :page-size 10, :hash \"5drc3ac5ux7kS4h2vozdxwsrKDqSmn\"}, :nextjournal/render-opts {:auto-expand-results? true, :id \"calculus/anon-expr-5drDd2LGVKr21767ftpzBhT3dKeikG-result\"}}, :nextjournal/blob-id \"5ds7i4QcHmAsCR9h2WwzNCF9pZkGJW\"}, :nextjournal/render-opts {:auto-expand-results? true, :id \"calculus/anon-expr-5drDd2LGVKr21767ftpzBhT3dKeikG-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dsWjGqoSywgAc2wuJ2vRxwjmuq6FH\"} [:p [:<> \"Below \"] [:code [:<> \"vegas\"]] [:<> \" is set to the original algorithm (without stratification) with number of points is set to \"] [:code [:<> \"5000\"]] [:<> \", small number of importance sampling intervals. We will use Quasi Monte Carlo by using jittered Halton low-discrepancy sequence to generate samples.\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dsWjGqoSywgAc2wuJ2vRxwjmuq6FH\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(calc/vegas func [m/-PI m/-PI] [m/PI m/PI] {:info? true :nstrats 0 :nevals 5000\\n                                            :nintervals 20 :max-iters 51\\n                                            :random-sequence :halton :jitter 0.5})\", :nextjournal/render-opts {:loc {:line 523, :end-line 526, :column 1, :end-column 83}, :id \"calculus/anon-expr-5dskfJptEuc4X5VC3rQbbpMvMFWYeg-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value :Q, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [0 1], :nextjournal/value 1.0, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value :chi2-avg, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 1], :nextjournal/value 0.01601512580778919, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [2], :nextjournal/value [{:path [2 0], :nextjournal/value :dof, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [2 1], :nextjournal/value 50, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [3], :nextjournal/value [{:path [3 0], :nextjournal/value :evaluations, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [3 1], :nextjournal/value 255103, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [4], :nextjournal/value [{:path [4 0], :nextjournal/value :iterations, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [4 1], :nextjournal/value 51, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [5], :nextjournal/value [{:path [5 0], :nextjournal/value :nhcubes, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [5 1], :nextjournal/value 1, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [6], :nextjournal/value [{:path [6 0], :nextjournal/value :nintervals, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [6 1], :nextjournal/value 20, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [7], :nextjournal/value [{:path [7 0], :nextjournal/value :nstrats, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [7 1], :nextjournal/value [{:path [7 1 0], :nextjournal/value 1, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [7 1 1], :nextjournal/value 1, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/sequential-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-coll, :opening-paren \"(\", :closing-paren (\")\"), :page-size 20, :hash \"5dsgY1QgV2KqnvvrRRC3HXgCeF3Qge\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [8], :nextjournal/value [{:path [8 0], :nextjournal/value :result, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [8 1], :nextjournal/value 8.527763611773914, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [9], :nextjournal/value [{:path [9 0], :nextjournal/value :sd, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [9 1], :nextjournal/value 0.012837184515191209, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-map, :opening-paren \"{\", :closing-paren (\"}\"), :page-size 10, :hash \"5drc3ac5ux7kS4h2vozdxwsrKDqSmn\"}, :nextjournal/render-opts {:auto-expand-results? true, :id \"calculus/anon-expr-5dskfJptEuc4X5VC3rQbbpMvMFWYeg-result\"}}, :nextjournal/blob-id \"5dtDnBGUZLQh4b1GsoSpbcyM4dbGuw\"}, :nextjournal/render-opts {:auto-expand-results? true, :id \"calculus/anon-expr-5dskfJptEuc4X5VC3rQbbpMvMFWYeg-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dtGo2C2ks8fU58Q5gKheZcX95dNHs\"} [:p [:<> \"See how adaptation is performed at selected iterations. The 20x20 grid is squeezed and stretched to adopt to the function shape.\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dtGo2C2ks8fU58Q5gKheZcX95dNHs\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/content-type \"image/png\", :nextjournal/value \"./../../_data/8Vv9mgostDbNFozBFNz72ZT6Fyjt9hBsf4r9uixdS6H1o86TAPodkeQtfaRWe9CvSdU22m6wGrtHe1YLxoKCeYmAG9.png\", :nextjournal/width :wide, :nextjournal/viewer {:name nextjournal.clerk.viewer/image-viewer, :render-fn #viewer-fn (fn [blob-or-url] [:div.flex.flex-col.items-center.not-prose [:img {:src (nextjournal.clerk.render/url-for blob-or-url)}]]), :hash \"5dt7o6hJourKKwffBgPcV6ScgK5Xk7\"}} {:path [0 1], :nextjournal/value [:figcaption.text-xs.text-slate-500.text-center.mt-1 \"initial\"], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/col-viewer, :render-fn #viewer-fn (fn [items opts] (into [:div {:class \"md:flex md:flex-col md:gap-4 clerk-grid not-prose\", :style opts}] (map (fn [item] [:div.flex.items-center.justify-center (nextjournal.clerk.render/inspect-presented opts item)])) items)), :hash \"5drrk6RmQ397EVcBAWyEdoYfh6NSW3\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/content-type \"image/png\", :nextjournal/value \"./../../_data/8Vw4wHF3ntSsRKAvfYTudEvThsTcTBoH9rSMzEXaLfYAzhSen48pGGc6EvXBH16uRDniomx6BTmWghU4zwohHFZaVe.png\", :nextjournal/width :wide, :nextjournal/viewer {:name nextjournal.clerk.viewer/image-viewer, :render-fn #viewer-fn (fn [blob-or-url] [:div.flex.flex-col.items-center.not-prose [:img {:src (nextjournal.clerk.render/url-for blob-or-url)}]]), :hash \"5dt7o6hJourKKwffBgPcV6ScgK5Xk7\"}} {:path [1 1], :nextjournal/value [:figcaption.text-xs.text-slate-500.text-center.mt-1 \"1st iteration\"], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/col-viewer, :render-fn #viewer-fn (fn [items opts] (into [:div {:class \"md:flex md:flex-col md:gap-4 clerk-grid not-prose\", :style opts}] (map (fn [item] [:div.flex.items-center.justify-center (nextjournal.clerk.render/inspect-presented opts item)])) items)), :hash \"5drrk6RmQ397EVcBAWyEdoYfh6NSW3\"}} {:path [2], :nextjournal/value [{:path [2 0], :nextjournal/content-type \"image/png\", :nextjournal/value \"./../../_data/8VtWcwpqo4Usvm5P3cVqaiBiJQyEurC4P5F5GaKZsG72FNNYM63yao8xD8DeCx63HmtFKeBTpMAqYvMAPCwTcwrN7v.png\", :nextjournal/width :wide, :nextjournal/viewer {:name nextjournal.clerk.viewer/image-viewer, :render-fn #viewer-fn (fn [blob-or-url] [:div.flex.flex-col.items-center.not-prose [:img {:src (nextjournal.clerk.render/url-for blob-or-url)}]]), :hash \"5dt7o6hJourKKwffBgPcV6ScgK5Xk7\"}} {:path [2 1], :nextjournal/value [:figcaption.text-xs.text-slate-500.text-center.mt-1 \"5th\"], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/col-viewer, :render-fn #viewer-fn (fn [items opts] (into [:div {:class \"md:flex md:flex-col md:gap-4 clerk-grid not-prose\", :style opts}] (map (fn [item] [:div.flex.items-center.justify-center (nextjournal.clerk.render/inspect-presented opts item)])) items)), :hash \"5drrk6RmQ397EVcBAWyEdoYfh6NSW3\"}} {:path [3], :nextjournal/value [{:path [3 0], :nextjournal/content-type \"image/png\", :nextjournal/value \"./../../_data/8Vvu6ERMea5EuvTYUMtJSrW8mJ8sQSMG6JAoDeib4iUEJZJU7GrbLj2Aehz3YcHabwdXXHLq82CDWyapkZjNY5rL8z.png\", :nextjournal/width :wide, :nextjournal/viewer {:name nextjournal.clerk.viewer/image-viewer, :render-fn #viewer-fn (fn [blob-or-url] [:div.flex.flex-col.items-center.not-prose [:img {:src (nextjournal.clerk.render/url-for blob-or-url)}]]), :hash \"5dt7o6hJourKKwffBgPcV6ScgK5Xk7\"}} {:path [3 1], :nextjournal/value [:figcaption.text-xs.text-slate-500.text-center.mt-1 \"10th\"], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/col-viewer, :render-fn #viewer-fn (fn [items opts] (into [:div {:class \"md:flex md:flex-col md:gap-4 clerk-grid not-prose\", :style opts}] (map (fn [item] [:div.flex.items-center.justify-center (nextjournal.clerk.render/inspect-presented opts item)])) items)), :hash \"5drrk6RmQ397EVcBAWyEdoYfh6NSW3\"}} {:path [4], :nextjournal/value [{:path [4 0], :nextjournal/content-type \"image/png\", :nextjournal/value \"./../../_data/8VvTv4b54HvyUqweoRM4rHtPKcLDxddZJ5WeDyK2RT82kazsaxisCNpSTWo9F61YKWpMuchLBTNAvf7vLzT87FkmKf.png\", :nextjournal/width :wide, :nextjournal/viewer {:name nextjournal.clerk.viewer/image-viewer, :render-fn #viewer-fn (fn [blob-or-url] [:div.flex.flex-col.items-center.not-prose [:img {:src (nextjournal.clerk.render/url-for blob-or-url)}]]), :hash \"5dt7o6hJourKKwffBgPcV6ScgK5Xk7\"}} {:path [4 1], :nextjournal/value [:figcaption.text-xs.text-slate-500.text-center.mt-1 \"50th\"], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/col-viewer, :render-fn #viewer-fn (fn [items opts] (into [:div {:class \"md:flex md:flex-col md:gap-4 clerk-grid not-prose\", :style opts}] (map (fn [item] [:div.flex.items-center.justify-center (nextjournal.clerk.render/inspect-presented opts item)])) items)), :hash \"5drrk6RmQ397EVcBAWyEdoYfh6NSW3\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/row-viewer, :render-fn #viewer-fn (fn [items opts] (let [item-count (count items)] (into [:div {:class \"md:flex md:flex-row md:gap-4 not-prose\", :style opts}] (map (fn [item] [:div.flex.items-center.justify-center.flex-auto (nextjournal.clerk.render/inspect-presented opts item)])) items))), :hash \"5dtfAZrv4Z3ZyLyfNswjPiKLk9PBJH\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dqtsJ7jkYARGktqP58LYakQmd6sRs-result\"}}, :nextjournal/blob-id \"G__56596\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dqtsJ7jkYARGktqP58LYakQmd6sRs-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5drhL4HstXhdmAkmk4H37h2sfSFvw3\"} [:p [:<> \"When we add stratification the coverage is even better. Number of stratification is \"] [:code [:<> \"10*10=100\"]] [:<> \". \"] [:code [:<> \"beta\"]] [:<> \" is set to a little bit lower value than default (\"] [:code [:<> \"0.5\"]] [:<> \" vs \"] [:code [:<> \"0.75\"]] [:<> \"). The rest is as above.\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5drhL4HstXhdmAkmk4H37h2sfSFvw3\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(calc/vegas func [m/-PI m/-PI] [m/PI m/PI] {:info? true :nstrats 10\\n                                            :beta 0.5 :nevals 5000\\n                                            :nintervals 20 :max-iters 51\\n                                            :random-sequence :halton :jitter 0.5})\", :nextjournal/render-opts {:loc {:line 541, :end-line 545, :column 1, :end-column 83}, :id \"calculus/anon-expr-5dt5xdDRZuCTYSnQGzei7oozNXDfzJ-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value :Q, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [0 1], :nextjournal/value 1.0, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value :chi2-avg, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 1], :nextjournal/value 0.04156886077923734, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [2], :nextjournal/value [{:path [2 0], :nextjournal/value :dof, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [2 1], :nextjournal/value 50, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [3], :nextjournal/value [{:path [3 0], :nextjournal/value :evaluations, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [3 1], :nextjournal/value 262731, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [4], :nextjournal/value [{:path [4 0], :nextjournal/value :iterations, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [4 1], :nextjournal/value 51, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [5], :nextjournal/value [{:path [5 0], :nextjournal/value :nhcubes, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [5 1], :nextjournal/value 100, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [6], :nextjournal/value [{:path [6 0], :nextjournal/value :nintervals, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [6 1], :nextjournal/value 20, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [7], :nextjournal/value [{:path [7 0], :nextjournal/value :nstrats, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [7 1], :nextjournal/value [{:path [7 1 0], :nextjournal/value 10, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [7 1 1], :nextjournal/value 10, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/sequential-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-coll, :opening-paren \"(\", :closing-paren (\")\"), :page-size 20, :hash \"5dsgY1QgV2KqnvvrRRC3HXgCeF3Qge\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [8], :nextjournal/value [{:path [8 0], :nextjournal/value :result, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [8 1], :nextjournal/value 8.528132445584797, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [9], :nextjournal/value [{:path [9 0], :nextjournal/value :sd, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [9 1], :nextjournal/value 0.005371049183585523, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-map, :opening-paren \"{\", :closing-paren (\"}\"), :page-size 10, :hash \"5drc3ac5ux7kS4h2vozdxwsrKDqSmn\"}, :nextjournal/render-opts {:auto-expand-results? true, :id \"calculus/anon-expr-5dt5xdDRZuCTYSnQGzei7oozNXDfzJ-result\"}}, :nextjournal/blob-id \"5dtDAv7ZXjcEtuAn5qUfiVv6ZCK9n2\"}, :nextjournal/render-opts {:auto-expand-results? true, :id \"calculus/anon-expr-5dt5xdDRZuCTYSnQGzei7oozNXDfzJ-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dtoySLTZVoDVq3ZTT18mCoMzbdKf7\"} [:p [:<> \"You can observe that flat surfaces are less sampled than the areas where function varies most.\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dtoySLTZVoDVq3ZTT18mCoMzbdKf7\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/content-type \"image/png\", :nextjournal/value \"./../../_data/8VvezvVzcFaJ3as2MnBwLbfHRZ1w9R3xD5EQsQqCrtwNVYx538caTUxPsWjAd7NYhRmNTkpD2AULB4KwSRc13HVwoV.png\", :nextjournal/width :wide, :nextjournal/viewer {:name nextjournal.clerk.viewer/image-viewer, :render-fn #viewer-fn (fn [blob-or-url] [:div.flex.flex-col.items-center.not-prose [:img {:src (nextjournal.clerk.render/url-for blob-or-url)}]]), :hash \"5dt7o6hJourKKwffBgPcV6ScgK5Xk7\"}} {:path [0 1], :nextjournal/value [:figcaption.text-xs.text-slate-500.text-center.mt-1 \"initial\"], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/col-viewer, :render-fn #viewer-fn (fn [items opts] (into [:div {:class \"md:flex md:flex-col md:gap-4 clerk-grid not-prose\", :style opts}] (map (fn [item] [:div.flex.items-center.justify-center (nextjournal.clerk.render/inspect-presented opts item)])) items)), :hash \"5drrk6RmQ397EVcBAWyEdoYfh6NSW3\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/content-type \"image/png\", :nextjournal/value \"./../../_data/8VvzRN13phC1tEcFYQznVdJ46UFWTyGViKNXhGcQUXq3AMpHDW2FNtGaqJgMegHDXyhufVusJhSY79hk8YFFKh8fhm.png\", :nextjournal/width :wide, :nextjournal/viewer {:name nextjournal.clerk.viewer/image-viewer, :render-fn #viewer-fn (fn [blob-or-url] [:div.flex.flex-col.items-center.not-prose [:img {:src (nextjournal.clerk.render/url-for blob-or-url)}]]), :hash \"5dt7o6hJourKKwffBgPcV6ScgK5Xk7\"}} {:path [1 1], :nextjournal/value [:figcaption.text-xs.text-slate-500.text-center.mt-1 \"1st iteration\"], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/col-viewer, :render-fn #viewer-fn (fn [items opts] (into [:div {:class \"md:flex md:flex-col md:gap-4 clerk-grid not-prose\", :style opts}] (map (fn [item] [:div.flex.items-center.justify-center (nextjournal.clerk.render/inspect-presented opts item)])) items)), :hash \"5drrk6RmQ397EVcBAWyEdoYfh6NSW3\"}} {:path [2], :nextjournal/value [{:path [2 0], :nextjournal/content-type \"image/png\", :nextjournal/value \"./../../_data/8VvtDfUvy6wyg53Gw7VmVE3MXSWRatDGqUZVqiMoX1eSJrnvigWs68m4ZWXxmpXAmz9TwmZcPyLbYyAqhu21wtJ9k5.png\", :nextjournal/width :wide, :nextjournal/viewer {:name nextjournal.clerk.viewer/image-viewer, :render-fn #viewer-fn (fn [blob-or-url] [:div.flex.flex-col.items-center.not-prose [:img {:src (nextjournal.clerk.render/url-for blob-or-url)}]]), :hash \"5dt7o6hJourKKwffBgPcV6ScgK5Xk7\"}} {:path [2 1], :nextjournal/value [:figcaption.text-xs.text-slate-500.text-center.mt-1 \"5th\"], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/col-viewer, :render-fn #viewer-fn (fn [items opts] (into [:div {:class \"md:flex md:flex-col md:gap-4 clerk-grid not-prose\", :style opts}] (map (fn [item] [:div.flex.items-center.justify-center (nextjournal.clerk.render/inspect-presented opts item)])) items)), :hash \"5drrk6RmQ397EVcBAWyEdoYfh6NSW3\"}} {:path [3], :nextjournal/value [{:path [3 0], :nextjournal/content-type \"image/png\", :nextjournal/value \"./../../_data/8Vxggg6duxn3wa4JZVMQeVpQTVt9Wmb2UMWb7LAFgxeTMzfe3cb8C9zY988KVRzgz3NhLqqqRvqDnm1CZso8ksgLkL.png\", :nextjournal/width :wide, :nextjournal/viewer {:name nextjournal.clerk.viewer/image-viewer, :render-fn #viewer-fn (fn [blob-or-url] [:div.flex.flex-col.items-center.not-prose [:img {:src (nextjournal.clerk.render/url-for blob-or-url)}]]), :hash \"5dt7o6hJourKKwffBgPcV6ScgK5Xk7\"}} {:path [3 1], :nextjournal/value [:figcaption.text-xs.text-slate-500.text-center.mt-1 \"10th\"], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/col-viewer, :render-fn #viewer-fn (fn [items opts] (into [:div {:class \"md:flex md:flex-col md:gap-4 clerk-grid not-prose\", :style opts}] (map (fn [item] [:div.flex.items-center.justify-center (nextjournal.clerk.render/inspect-presented opts item)])) items)), :hash \"5drrk6RmQ397EVcBAWyEdoYfh6NSW3\"}} {:path [4], :nextjournal/value [{:path [4 0], :nextjournal/content-type \"image/png\", :nextjournal/value \"./../../_data/8VwenWm2hMXLijy5F6A3ZnSx7Y6AyTm882jtw91XeRVPsoar6tjL7iFdvQJeFxMrVyy6nE3huuNcWmHRM9ko8gfd7e.png\", :nextjournal/width :wide, :nextjournal/viewer {:name nextjournal.clerk.viewer/image-viewer, :render-fn #viewer-fn (fn [blob-or-url] [:div.flex.flex-col.items-center.not-prose [:img {:src (nextjournal.clerk.render/url-for blob-or-url)}]]), :hash \"5dt7o6hJourKKwffBgPcV6ScgK5Xk7\"}} {:path [4 1], :nextjournal/value [:figcaption.text-xs.text-slate-500.text-center.mt-1 \"50th\"], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/col-viewer, :render-fn #viewer-fn (fn [items opts] (into [:div {:class \"md:flex md:flex-col md:gap-4 clerk-grid not-prose\", :style opts}] (map (fn [item] [:div.flex.items-center.justify-center (nextjournal.clerk.render/inspect-presented opts item)])) items)), :hash \"5drrk6RmQ397EVcBAWyEdoYfh6NSW3\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/row-viewer, :render-fn #viewer-fn (fn [items opts] (let [item-count (count items)] (into [:div {:class \"md:flex md:flex-row md:gap-4 not-prose\", :style opts}] (map (fn [item] [:div.flex.items-center.justify-center.flex-auto (nextjournal.clerk.render/inspect-presented opts item)])) items))), :hash \"5dtfAZrv4Z3ZyLyfNswjPiKLk9PBJH\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5du7oGgHjL7fp589iRkzP5eitr7h76-result\"}}, :nextjournal/blob-id \"G__56599\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5du7oGgHjL7fp589iRkzP5eitr7h76-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dqpLaX5drGd7icVPFzbQjGcAxWKgz\"} [:p [:<> \"Now let's see the result of examples explored in \"] [:code [:<> \"cubature\"]] [:<> \" section: multi-normal and 3d ball volume.\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dqpLaX5drGd7icVPFzbQjGcAxWKgz\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(repeatedly 5 #(calc/vegas multi-normal\\n                           [##-Inf ##-Inf]\\n                           [##Inf ##Inf]\\n                           {:max-iters 20 :warmup 5\\n                            :nstrats 5\\n                            :abs 1.0e-6 :rel 1.0e-6\\n                            :max-evals 50000}))\", :nextjournal/render-opts {:loc {:line 559, :end-line 566, :column 1, :end-column 48}, :id \"calculus/anon-expr-5dtWSHyhy3XosUoPsHDi1h1SFam3oE-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value 1.0002192478690655, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [1], :nextjournal/value 0.9999601591401115, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [2], :nextjournal/value 0.9996967042310411, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [3], :nextjournal/value 1.0001084787955206, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [4], :nextjournal/value 0.9997736692927212, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/sequential-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-coll, :opening-paren \"(\", :closing-paren (\")\"), :page-size 20, :hash \"5dsgY1QgV2KqnvvrRRC3HXgCeF3Qge\"}, :nextjournal/render-opts {:auto-expand-results? true, :id \"calculus/anon-expr-5dtWSHyhy3XosUoPsHDi1h1SFam3oE-result\"}}, :nextjournal/blob-id \"5dtCW3Gd7ceNxAvHbuH72RbZWLMKXk\"}, :nextjournal/render-opts {:auto-expand-results? true, :id \"calculus/anon-expr-5dtWSHyhy3XosUoPsHDi1h1SFam3oE-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value \"(defn volume-3d-ball-vegas [R]\\n  (calc/vegas volume-3d-ball-integrant [0 0 0] [m/PI m/TWO_PI R] {:rel 1.0e-6 :abs 1.0e-6\\n                                                                  :warmup 5\\n                                                                  :max-iters 20}))\", :nextjournal/render-opts {:loc {:line 568, :end-line 571, :column 1, :end-column 83}, :id \"calculus/volume-3d-ball-vegas-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value \"#function[calculus/volume-3d-ball-vegas]\", :nextjournal/viewer {:name nextjournal.clerk.viewer/read+inspect-viewer, :render-fn #viewer-fn (fn [x] (try [nextjournal.clerk.render/inspect (nextjournal.clerk.viewer/read-string-without-tag-table x)] (catch js/Error _e (nextjournal.clerk.render/render-unreadable-edn x)))), :hash \"5draK8r6Qh96paK7hAAz4TKbfdrpV4\"}, :nextjournal/render-opts {:id \"calculus/volume-3d-ball-vegas-result\"}}, :nextjournal/blob-id nil}, :nextjournal/render-opts {:id \"calculus/volume-3d-ball-vegas-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value \"(volume-3d-ball-vegas 1)\", :nextjournal/render-opts {:loc {:line 573, :end-line 573, :column 1, :end-column 25}, :id \"calculus/anon-expr-5ds88bz6qiHmSweXAuBSMsTyqCjRXh-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value 4.188680861696358, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5ds88bz6qiHmSweXAuBSMsTyqCjRXh-result\"}}, :nextjournal/blob-id \"5dttJ94ndEMXMkNm8eRyCKu2eLKLjb\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5ds88bz6qiHmSweXAuBSMsTyqCjRXh-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value \"R\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 1], :nextjournal/value \"integral\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 2], :nextjournal/value \"expected\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 3], :nextjournal/value \"error\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-head-viewer, :render-fn #viewer-fn (fn [header-row {:as opts, :keys [path number-col?]}] [:thead (into [:tr] (map-indexed (fn [i {:as header-cell, :nextjournal/keys [value]}] (let [title (when (or (string? value) (keyword? value) (symbol? value)) value)] [:th.pl-6.pr-2.py-1.align-bottom.font-medium.top-0.z-10.bg-white.dark:bg-slate-900.border-b.border-gray-300.dark:border-slate-700 (cond-> {:class (when (and (ifn? number-col?) (number-col? i)) \"text-right\")} title (assoc :title title)) (nextjournal.clerk.render/inspect-presented opts header-cell)]))) header-row)]), :hash \"5dsuyZRvJwykvdxHCRoj1p24Ru4wYR\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value [{:path [1 0 0], :nextjournal/value 0.1, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 0 1], :nextjournal/value 0.004189599202407277, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 0 2], :nextjournal/value 0.004188790204786391, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 0 3], :nextjournal/value 8.08997620885786E-7, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 1], :nextjournal/value [{:path [1 1 0], :nextjournal/value 0.5, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 1 1], :nextjournal/value 0.5235969831573074, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 1 2], :nextjournal/value 0.5235987755982988, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 1 3], :nextjournal/value 1.7924409914105155E-6, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 2], :nextjournal/value [{:path [1 2 0], :nextjournal/value 1.0, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 2 1], :nextjournal/value 4.189159684860458, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 2 2], :nextjournal/value 4.1887902047863905, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 2 3], :nextjournal/value 3.69480074067674E-4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 3], :nextjournal/value [{:path [1 3 0], :nextjournal/value 2.0, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 3 1], :nextjournal/value 33.5150061404804, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 3 2], :nextjournal/value 33.510321638291124, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 3 3], :nextjournal/value 0.0046845021892778504, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 4], :nextjournal/value [{:path [1 4 0], :nextjournal/value 5.0, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 4 1], :nextjournal/value 523.6902813963479, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 4 2], :nextjournal/value 523.5987755982989, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 4 3], :nextjournal/value 0.09150579804907011, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 5], :nextjournal/value [{:path [1 5 0], :nextjournal/value 20.0, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 5 1], :nextjournal/value 33509.75014791058, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 5 2], :nextjournal/value 33510.32163829113, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}} {:path [1 5 3], :nextjournal/value 0.5714903805492213, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-body-viewer, :render-fn #viewer-fn (fn [rows opts] (into [:tbody] (map-indexed (fn [idx row] (nextjournal.clerk.render/inspect-presented (update opts :path conj idx) row))) rows)), :hash \"5dsefivD6wgJ7qkFYswJThKvfZ3x3P\"}}], :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 4, :number-col? #{0 1 3 2}, :id \"calculus/anon-expr-5dr1KMSXjffYcV5P3zhpmnARijEJDE-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/table-markup-viewer, :render-fn #viewer-fn (fn [head+body opts] [:div (into [nextjournal.clerk.render/render-table-with-sticky-header] (nextjournal.clerk.render/inspect-children opts) head+body)]), :hash \"5drXFLdHZgfgZHMAR1nVZrHeF8oNVJ\"}}, :nextjournal/blob-id \"5dtoSSUJpzUARUi6ApNQRd8hiBYuxe\"}, :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 4, :number-col? #{0 1 3 2}, :id \"calculus/anon-expr-5dr1KMSXjffYcV5P3zhpmnARijEJDE-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5drMeVG5Df9QpYGVNRXh7ayRaTUcWB\"} [:p [:<> \"The last example show the ability to calculate integral when the function is really high dimensional. Let's consider the function:\"]] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"f(\\\\vec{v}) = e^{-\\\\|\\\\vec{v}\\\\|_2^2}\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}]], :nextjournal/render-opts {:id \"calculus/markdown-5drMeVG5Df9QpYGVNRXh7ayRaTUcWB\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(defn exp-magsq-v\\n  ^double [v] (m/exp (m/- (v/magsq v))))\", :nextjournal/render-opts {:loc {:line 587, :end-line 588, :column 1, :end-column 41}, :id \"calculus/exp-magsq-v-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value \"#function[calculus/exp-magsq-v]\", :nextjournal/viewer {:name nextjournal.clerk.viewer/read+inspect-viewer, :render-fn #viewer-fn (fn [x] (try [nextjournal.clerk.render/inspect (nextjournal.clerk.viewer/read-string-without-tag-table x)] (catch js/Error _e (nextjournal.clerk.render/render-unreadable-edn x)))), :hash \"5draK8r6Qh96paK7hAAz4TKbfdrpV4\"}, :nextjournal/render-opts {:id \"calculus/exp-magsq-v-result\"}}, :nextjournal/blob-id nil}, :nextjournal/render-opts {:id \"calculus/exp-magsq-v-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dsQjUgv5WnRN8feieeSHwddMUvZ1o\"} [:p [:<> \"And the intergal over volume \"] [:code [:<> \"V\"]] [:<> \".\"]] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"\\\\mathop{\\\\int\\\\dots\\\\int}\\\\limits_V e^{-\\\\|\\\\vec{v}\\\\|_2^2}\\\\,dV = \\\\left[\\\\frac{\\\\sqrt\\\\pi}{2}\\\\left(erf(1)+erf(3)\\\\right)\\\\right]^n\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"\\\\textrm{ where } V=[-1,3]\\\\times\\\\dots\\\\times[-1,3]\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}]], :nextjournal/render-opts {:id \"calculus/markdown-5dsQjUgv5WnRN8feieeSHwddMUvZ1o\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(defn exp-magsq-v-result\\n  [n] (m/fpow (* m/SQRTPI 0.5 (+ (m/erf 1) (m/erf 3))) n))\", :nextjournal/render-opts {:loc {:line 595, :end-line 596, :column 1, :end-column 59}, :id \"calculus/exp-magsq-v-result-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value \"#function[calculus/exp-magsq-v-result]\", :nextjournal/viewer {:name nextjournal.clerk.viewer/read+inspect-viewer, :render-fn #viewer-fn (fn [x] (try [nextjournal.clerk.render/inspect (nextjournal.clerk.viewer/read-string-without-tag-table x)] (catch js/Error _e (nextjournal.clerk.render/render-unreadable-edn x)))), :hash \"5draK8r6Qh96paK7hAAz4TKbfdrpV4\"}, :nextjournal/render-opts {:id \"calculus/exp-magsq-v-result-result\"}}, :nextjournal/blob-id nil}, :nextjournal/render-opts {:id \"calculus/exp-magsq-v-result-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dstBY4SvjrvPy6hEeM9Cb3vsvu8hn\"} [:p [:<> \"Now we compare two results, one from \"] [:code [:<> \"cubature\"]] [:<> \" and second from \"] [:code [:<> \"vegas\"]] [:<> \" in 2d.\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dstBY4SvjrvPy6hEeM9Cb3vsvu8hn\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(exp-magsq-v-result 2)\", :nextjournal/render-opts {:loc {:line 600, :end-line 600, :column 1, :end-column 23}, :id \"calculus/anon-expr-5dr4b7LfpXxgJchdyygUZNMwf5nraT-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value 2.666791818172041, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dr4b7LfpXxgJchdyygUZNMwf5nraT-result\"}}, :nextjournal/blob-id \"5dsyFsDXK9hmy3RowsZiR5xsVddmLK\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dr4b7LfpXxgJchdyygUZNMwf5nraT-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value \"(def cubature-result (calc/cubature exp-magsq-v [-1 -1] [3 3] {:max-iters 1000\\n                                                             :abs 1.0e-8\\n                                                             :rel 1.0e-8\\n                                                             :info? true}))\", :nextjournal/render-opts {:loc {:line 602, :end-line 606, :column 1, :end-column 76}, :id \"calculus/cubature-result-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value :error, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [0 1], :nextjournal/value 2.6650091410038035E-8, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value :evaluations, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 1], :nextjournal/value 9894, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [2], :nextjournal/value [{:path [2 0], :nextjournal/value :fail?, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [2 1], :nextjournal/value false, :nextjournal/viewer {:name nextjournal.clerk.viewer/boolean-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-bool.inspected-value (str x)]), :hash \"5drtojy56K7q7gy8rvTRBwpzg8DdcJ\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [3], :nextjournal/value [{:path [3 0], :nextjournal/value :iterations, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [3 1], :nextjournal/value 579, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [4], :nextjournal/value [{:path [4 0], :nextjournal/value :result, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [4 1], :nextjournal/value 2.666791818171282, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [5], :nextjournal/value [{:path [5 0], :nextjournal/value :subdivisions, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [5 1], :nextjournal/value 582, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-map, :opening-paren \"{\", :closing-paren (\"}\"), :page-size 10, :hash \"5drc3ac5ux7kS4h2vozdxwsrKDqSmn\"}, :nextjournal/render-opts {:auto-expand-results? true, :id \"calculus/cubature-result-result\"}}, :nextjournal/blob-id \"5dteaqcg6CqRnbswute4dWXNP8GGXs\"}, :nextjournal/render-opts {:auto-expand-results? true, :id \"calculus/cubature-result-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value \"(def vegas-result (calc/vegas exp-magsq-v [-1 -1] [3 3] {:warmup 5\\n                                                       :max-iters 50 :nevals 100000\\n                                                       :random-sequence :r2\\n                                                       :info? true}))\", :nextjournal/render-opts {:loc {:line 608, :end-line 612, :column 1, :end-column 70}, :id \"calculus/vegas-result-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value :Q, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [0 1], :nextjournal/value 0.9932170018316026, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value :chi2-avg, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 1], :nextjournal/value 7.227261005068589E-5, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [2], :nextjournal/value [{:path [2 0], :nextjournal/value :dof, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [2 1], :nextjournal/value 1, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [3], :nextjournal/value [{:path [3 0], :nextjournal/value :evaluations, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [3 1], :nextjournal/value 993567, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [4], :nextjournal/value [{:path [4 0], :nextjournal/value :iterations, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [4 1], :nextjournal/value 2, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [5], :nextjournal/value [{:path [5 0], :nextjournal/value :nhcubes, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [5 1], :nextjournal/value 24964, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [6], :nextjournal/value [{:path [6 0], :nextjournal/value :nintervals, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [6 1], :nextjournal/value 1106, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [7], :nextjournal/value [{:path [7 0], :nextjournal/value :nstrats, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [7 1], :nextjournal/value [{:path [7 1 0], :nextjournal/value 158, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [7 1 1], :nextjournal/value 158, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/sequential-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-coll, :opening-paren \"(\", :closing-paren (\")\"), :page-size 20, :hash \"5dsgY1QgV2KqnvvrRRC3HXgCeF3Qge\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [8], :nextjournal/value [{:path [8 0], :nextjournal/value :result, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [8 1], :nextjournal/value 2.666803129024596, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [9], :nextjournal/value [{:path [9 0], :nextjournal/value :sd, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [9 1], :nextjournal/value 4.643132412040161E-4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-map, :opening-paren \"{\", :closing-paren (\"}\"), :page-size 10, :hash \"5drc3ac5ux7kS4h2vozdxwsrKDqSmn\"}, :nextjournal/render-opts {:auto-expand-results? true, :id \"calculus/vegas-result-result\"}}, :nextjournal/blob-id \"8VvcdN19aAi2axEKjL4Q24v834PPaCRLC8CLeX6yUWvuGs4qUhwoCpWVeb6G4z8qhY9iDaQDuymNEU8KSDPdiJENBt\"}, :nextjournal/render-opts {:auto-expand-results? true, :id \"calculus/vegas-result-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value \"{:vegas-error (m/abs (- (exp-magsq-v-result 2) (:result vegas-result)))\\n :cubature-error (m/abs (- (exp-magsq-v-result 2) (:result cubature-result)))}\", :nextjournal/render-opts {:loc {:line 614, :end-line 616, :column 1, :end-column 79}, :id \"calculus/anon-expr-5drzepCqNBEtvmpJQ5RNF1fgwT1uJc-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value :cubature-error, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [0 1], :nextjournal/value 7.58948459633757E-13, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value :vegas-error, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 1], :nextjournal/value 1.1310852555013184E-5, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-map, :opening-paren \"{\", :closing-paren (\"}\"), :page-size 10, :hash \"5drc3ac5ux7kS4h2vozdxwsrKDqSmn\"}, :nextjournal/render-opts {:auto-expand-results? true, :id \"calculus/anon-expr-5drzepCqNBEtvmpJQ5RNF1fgwT1uJc-result\"}}, :nextjournal/blob-id \"8VtX9yF9taTiMC3cK5Dw33bfpJmxGeCe62stTZ93rCFbEP6ZYxYGHV4AP9Kj5ULv3rJqQetC9BNgbfzWyLfALLj7qH\"}, :nextjournal/render-opts {:auto-expand-results? true, :id \"calculus/anon-expr-5drzepCqNBEtvmpJQ5RNF1fgwT1uJc-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5drLbtNYn5vureR28aRoVwQcJYEiXi\"} [:p [:<> \"And now in 16-dimensional volume:\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5drLbtNYn5vureR28aRoVwQcJYEiXi\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(exp-magsq-v-result 16)\", :nextjournal/render-opts {:loc {:line 620, :end-line 620, :column 1, :end-column 24}, :id \"calculus/anon-expr-5drtW8ABH1yMsCrrCktW96Xo8GiHNK-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value 2558.0728724749197, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5drtW8ABH1yMsCrrCktW96Xo8GiHNK-result\"}}, :nextjournal/blob-id \"5dtMc7gm4bN84ntYE84ZEiP1xEWUQq\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5drtW8ABH1yMsCrrCktW96Xo8GiHNK-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dss8xjkpdbmqtoiLecaCKuFXbMBM1\"} [:p [:<> \"Let's limit hypercubes in stratification and subdivide every second dimension. Also we lower adaptation ratio for stratification.\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dss8xjkpdbmqtoiLecaCKuFXbMBM1\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(calc/vegas exp-magsq-v (repeat 16 -1) (repeat 16 3) {:nstrats [4 1 2 1]\\n                                                      :beta 0.2\\n                                                      :warmup 1 :nevals 150000\\n                                                      :max-iters 10 :info? true})\", :nextjournal/render-opts {:loc {:line 624, :end-line 628, :column 1, :end-column 82}, :id \"calculus/anon-expr-5drnTDVW1NKfohq6BCg4bipfFWPKre-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value :Q, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [0 1], :nextjournal/value 0.20630523081209837, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value :chi2-avg, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 1], :nextjournal/value 1.34732050792082, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [2], :nextjournal/value [{:path [2 0], :nextjournal/value :dof, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [2 1], :nextjournal/value 9, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [3], :nextjournal/value [{:path [3 0], :nextjournal/value :evaluations, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [3 1], :nextjournal/value 1717085, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [4], :nextjournal/value [{:path [4 0], :nextjournal/value :iterations, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [4 1], :nextjournal/value 10, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [5], :nextjournal/value [{:path [5 0], :nextjournal/value :nhcubes, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [5 1], :nextjournal/value 4096, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [6], :nextjournal/value [{:path [6 0], :nextjournal/value :nintervals, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [6 1], :nextjournal/value 1000, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [7], :nextjournal/value [{:path [7 0], :nextjournal/value :nstrats, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [7 1], :nextjournal/value [{:path [7 1 0], :nextjournal/value 4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [7 1 1], :nextjournal/value 1, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [7 1 2], :nextjournal/value 2, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [7 1 3], :nextjournal/value 1, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [7 1 4], :nextjournal/value 4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [7 1 5], :nextjournal/value 1, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [7 1 6], :nextjournal/value 2, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [7 1 7], :nextjournal/value 1, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [7 1 8], :nextjournal/value 4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [7 1 9], :nextjournal/value 1, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [7 1 10], :nextjournal/value 2, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [7 1 11], :nextjournal/value 1, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [7 1 12], :nextjournal/value 4, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [7 1 13], :nextjournal/value 1, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [7 1 14], :nextjournal/value 2, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [7 1 15], :nextjournal/value 1, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/sequential-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-coll, :opening-paren \"(\", :closing-paren (\")\"), :page-size 20, :hash \"5dsgY1QgV2KqnvvrRRC3HXgCeF3Qge\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [8], :nextjournal/value [{:path [8 0], :nextjournal/value :result, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [8 1], :nextjournal/value 2558.51987360295, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}} {:path [9], :nextjournal/value [{:path [9 0], :nextjournal/value :sd, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [9 1], :nextjournal/value 3.117707252897072, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-entry-viewer, :render-fn #viewer-fn (fn [xs opts] (into [:<>] (comp (nextjournal.clerk.render/inspect-children opts) (interpose \" \")) xs)), :page-size 2, :hash \"5dsxFB9emxPBEJRUNCz6BJ73x9BinY\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/map-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-map, :opening-paren \"{\", :closing-paren (\"}\"), :page-size 10, :hash \"5drc3ac5ux7kS4h2vozdxwsrKDqSmn\"}, :nextjournal/render-opts {:auto-expand-results? true, :id \"calculus/anon-expr-5drnTDVW1NKfohq6BCg4bipfFWPKre-result\"}}, :nextjournal/blob-id \"5dsiHq8u1br1812JUYMeimJm6Fdp4M\"}, :nextjournal/render-opts {:auto-expand-results? true, :id \"calculus/anon-expr-5drnTDVW1NKfohq6BCg4bipfFWPKre-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dsCY7cpxbgqcGHsUgF3gLJ3GuBDfz\"} [\"h2\" {:id \"solvers\"} [:<> \"Solvers\"]] [:p [:<> \"Solvers are used to find zeros of given \"] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"R\\\\to R\", :nextjournal/viewer {:name :nextjournal.markdown/formula, :render-fn #viewer-fn (fn [tex] (nextjournal.clerk.render/render-katex tex {:inline? true})), :hash \"5dtTBivp9Yiw7XSqxv1opZHNencsu6\"}}] [:<> \" function.\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5dsCY7cpxbgqcGHsUgF3gLJ3GuBDfz\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(require '[fastmath.solver :as solver])\", :nextjournal/render-opts {:loc {:line 637, :end-line 637, :column 1, :end-column 40}, :id \"calculus/anon-expr-5dtRHQZtGkJqdYSWmuxAV3jNVMAFdQ-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value nil, :nextjournal/viewer {:name nextjournal.clerk.viewer/nil-viewer, :render-fn #viewer-fn (fn [_] [:span.cmt-default.inspected-value \"nil\"]), :hash \"5ds3x8WPypHpZ82nScxBB4onExS7LG\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dtRHQZtGkJqdYSWmuxAV3jNVMAFdQ-result\"}}, :nextjournal/blob-id \"8VxMLktXDdtVMc8iXimmtZ8NSKSLuY18iS4X8ByUYe38wJcyDLyPHV17oQkSvYDuZuMZzBdwAVhWgxupuvjsQC4uMd\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dtRHQZtGkJqdYSWmuxAV3jNVMAFdQ-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value \"symbol\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 1], :nextjournal/value \"info\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-head-viewer, :render-fn #viewer-fn (fn [header-row {:as opts, :keys [path number-col?]}] [:thead (into [:tr] (map-indexed (fn [i {:as header-cell, :nextjournal/keys [value]}] (let [title (when (or (string? value) (keyword? value) (symbol? value)) value)] [:th.pl-6.pr-2.py-1.align-bottom.font-medium.top-0.z-10.bg-white.dark:bg-slate-900.border-b.border-gray-300.dark:border-slate-700 (cond-> {:class (when (and (ifn? number-col?) (number-col? i)) \"text-right\")} title (assoc :title title)) (nextjournal.clerk.render/inspect-presented opts header-cell)]))) header-row)]), :hash \"5dsuyZRvJwykvdxHCRoj1p24Ru4wYR\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value [{:path [1 0 0], :nextjournal/value \"find-root\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}} {:path [1 0 1], :nextjournal/value \"Find zero of a function in given interval\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 1], :nextjournal/value [{:path [1 1 0], :nextjournal/value \"quadratic\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}} {:path [1 1 1], :nextjournal/value \"Solve quadratic equation\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-body-viewer, :render-fn #viewer-fn (fn [rows opts] (into [:tbody] (map-indexed (fn [idx row] (nextjournal.clerk.render/inspect-presented (update opts :path conj idx) row))) rows)), :hash \"5dsefivD6wgJ7qkFYswJThKvfZ3x3P\"}}], :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 2, :number-col? #{}, :id \"calculus/anon-expr-5drLkjPSTd3skEkEh1fm1a8kQ1RSAy-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/table-markup-viewer, :render-fn #viewer-fn (fn [head+body opts] [:div (into [nextjournal.clerk.render/render-table-with-sticky-header] (nextjournal.clerk.render/inspect-children opts) head+body)]), :hash \"5drXFLdHZgfgZHMAR1nVZrHeF8oNVJ\"}}, :nextjournal/blob-id \"5draeiMTyCj1Q1KVA5CnionavY8v1Y\"}, :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 2, :number-col? #{}, :id \"calculus/anon-expr-5drLkjPSTd3skEkEh1fm1a8kQ1RSAy-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5dsYRn9Szhx1tEZ5iHAcLLofmUt9UP\"} [\"h3\" {:id \"solver\"} [:<> \"Solver\"]] [:p [:code [:<> \"find-root\"]] [:<> \" function accepts a function and bounds. Additional options are:\"]] [:ul [:li [:<> [:code [:<> \":absolute-accuracy\"]] [:<> \" - absolute tolerance\"]]] [:li [:<> [:code [:<> \":relative-accuracy\"]] [:<> \" - relative tolerance\"]]] [:li [:<> [:code [:<> \":max-iters\"]] [:<> \" - maximum number of iterations\"]]] [:li [:<> [:code [:<> \"initial-value\"]] [:<> \" - starting point\"]]] [:li [:<> [:code [:<> \"solver\"]] [:<> \" - algorithm used to find root of the function, one of: \"] [:code [:<> \":brent\"]] [:<> \" (default), \"] [:code [:<> \":bisection\"]] [:<> \", \"] [:code [:<> \":illinois\"]] [:<> \", \"] [:code [:<> \":muller\"]] [:<> \", \"] [:code [:<> \":muller2\"]] [:<> \", \"] [:code [:<> \":pegasus\"]] [:<> \", \"] [:code [:<> \":regula-falsi\"]] [:<> \", \"] [:code [:<> \":ridders\"]] [:<> \" and \"] [:code [:<> \":secant\"]]]]] [:p [:<> \"For given function:\"]] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"f(x) = \\\\cos{x}\\\\left( x-1 \\\\right)^3\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}]], :nextjournal/render-opts {:id \"calculus/markdown-5dsYRn9Szhx1tEZ5iHAcLLofmUt9UP\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(defn solver-target ^double [^double x]\\n  (* (m/cos x) (m/fpow (dec x) 3)))\", :nextjournal/render-opts {:loc {:line 658, :end-line 659, :column 1, :end-column 36}, :id \"calculus/solver-target-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value \"#function[calculus/solver-target]\", :nextjournal/viewer {:name nextjournal.clerk.viewer/read+inspect-viewer, :render-fn #viewer-fn (fn [x] (try [nextjournal.clerk.render/inspect (nextjournal.clerk.viewer/read-string-without-tag-table x)] (catch js/Error _e (nextjournal.clerk.render/render-unreadable-edn x)))), :hash \"5draK8r6Qh96paK7hAAz4TKbfdrpV4\"}, :nextjournal/render-opts {:id \"calculus/solver-target-result\"}}, :nextjournal/blob-id nil}, :nextjournal/render-opts {:id \"calculus/solver-target-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5duLLpSMJrg78tyvmentzKK96GFUag\"} [:p [:<> \"we have a root for \"] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"x=1\", :nextjournal/viewer {:name :nextjournal.markdown/formula, :render-fn #viewer-fn (fn [tex] (nextjournal.clerk.render/render-katex tex {:inline? true})), :hash \"5dtTBivp9Yiw7XSqxv1opZHNencsu6\"}}] [:<> \" on a \"] [:code [:<> \"[-1.1, 1.1]\"]] [:<> \" range. As you can see, \"] [:code [:<> \":regula-falsi\"]] [:<> \" fails to find a root for given absolute accuracy (\"] [:code [:<> \"1.0e-10\"]] [:<> \" in this case)\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5duLLpSMJrg78tyvmentzKK96GFUag\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value \"solver\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}} {:path [0 1], :nextjournal/value \"result\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-head-viewer, :render-fn #viewer-fn (fn [header-row {:as opts, :keys [path number-col?]}] [:thead (into [:tr] (map-indexed (fn [i {:as header-cell, :nextjournal/keys [value]}] (let [title (when (or (string? value) (keyword? value) (symbol? value)) value)] [:th.pl-6.pr-2.py-1.align-bottom.font-medium.top-0.z-10.bg-white.dark:bg-slate-900.border-b.border-gray-300.dark:border-slate-700 (cond-> {:class (when (and (ifn? number-col?) (number-col? i)) \"text-right\")} title (assoc :title title)) (nextjournal.clerk.render/inspect-presented opts header-cell)]))) header-row)]), :hash \"5dsuyZRvJwykvdxHCRoj1p24Ru4wYR\"}} {:path [1], :nextjournal/value [{:path [1 0], :nextjournal/value [{:path [1 0 0], :nextjournal/value :brent, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 0 1], :nextjournal/value 0.9999999999963414, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 1], :nextjournal/value [{:path [1 1 0], :nextjournal/value :bisection, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 1 1], :nextjournal/value 0.9999999999970896, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 2], :nextjournal/value [{:path [1 2 0], :nextjournal/value :illinois, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 2 1], :nextjournal/value 1.000011235693606, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 3], :nextjournal/value [{:path [1 3 0], :nextjournal/value :muller, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 3 1], :nextjournal/value 0.9999898767484467, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 4], :nextjournal/value [{:path [1 4 0], :nextjournal/value :muller2, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 4 1], :nextjournal/value 0.9999916171597961, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 5], :nextjournal/value [{:path [1 5 0], :nextjournal/value :pegasus, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 5 1], :nextjournal/value 1.0000111187404095, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 6], :nextjournal/value [{:path [1 6 0], :nextjournal/value :regula-falsi, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 6 1], :nextjournal/value \"illegal state: maximal count (100) exceeded: evaluations\", :nextjournal/viewer {:name nextjournal.clerk.viewer/string-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-string, :page-size 80, :hash \"5dt3aDkKp71a96V8X8u4mDqsR21CU2\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 7], :nextjournal/value [{:path [1 7 0], :nextjournal/value :ridders, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 7 1], :nextjournal/value 1.0000102311455772, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}} {:path [1 8], :nextjournal/value [{:path [1 8 0], :nextjournal/value :secant, :nextjournal/viewer {:name nextjournal.clerk.viewer/keyword-viewer, :render-fn #viewer-fn (fn [x] [:span.cmt-atom.inspected-value (str x)]), :hash \"5dsfx9mcALxzChApdWd2EzRdf4zLLp\"}} {:path [1 8 1], :nextjournal/value 1.000010281419704, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn (fn [x] [:span.tabular-nums (if (js/Number.isNaN x) \"NaN\" (str x))]), :hash \"5dtK9hxd59Nb7LBQTUhY5qKuLPg6yT\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-row-viewer, :render-fn #viewer-fn (fn [row {:as opts, :keys [path number-col?]}] (into [:tr.hover:bg-gray-200.dark:hover:bg-slate-700 {:class (if (even? (peek path)) \"bg-black/5 dark:bg-gray-800\" \"bg-white dark:bg-gray-900\")}] (map-indexed (fn [idx cell] [:td.pl-6.pr-2.py-1 (when (and (ifn? number-col?) (number-col? idx)) {:class \"text-right\"}) (nextjournal.clerk.render/inspect-presented opts cell)])) row)), :hash \"5dsNjQAhNnVDpLKK1uo1Ca3Fsk3MwM\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/table-body-viewer, :render-fn #viewer-fn (fn [rows opts] (into [:tbody] (map-indexed (fn [idx row] (nextjournal.clerk.render/inspect-presented (update opts :path conj idx) row))) rows)), :hash \"5dsefivD6wgJ7qkFYswJThKvfZ3x3P\"}}], :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 2, :number-col? #{1}, :id \"calculus/anon-expr-5dsTE9aJEn4tekLGQvqynhTW4EEmA2-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/table-markup-viewer, :render-fn #viewer-fn (fn [head+body opts] [:div (into [nextjournal.clerk.render/render-table-with-sticky-header] (nextjournal.clerk.render/inspect-children opts) head+body)]), :hash \"5drXFLdHZgfgZHMAR1nVZrHeF8oNVJ\"}}, :nextjournal/blob-id \"5dtJ3TrqvNjyzcCAbBE4AndSsrtNPS\"}, :nextjournal/width :wide, :nextjournal/render-opts {:num-cols 2, :number-col? #{1}, :id \"calculus/anon-expr-5dsTE9aJEn4tekLGQvqynhTW4EEmA2-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5drAPnSAkj7nf7jNFufBEW8eKWzZdb\"} [:p [:code [:<> \":regula-falsi\"]] [:<> \" solver doesn't work well for above example but gives the result for below polynomial.\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5drAPnSAkj7nf7jNFufBEW8eKWzZdb\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value \"(solver/find-root (fn [x] (- (* x x) 0.1)) 0 1 {:solver :regula-falsi})\", :nextjournal/render-opts {:loc {:line 673, :end-line 673, :column 1, :end-column 72}, :id \"calculus/anon-expr-5drBddrWRPHHiMTpvj9GUGaKRtoRGx-code\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-block-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code-block, :hash \"5dru1FUcVRTRrVKJFbNw4FG2wXmiwB\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value 0.3162277660168369, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5drBddrWRPHHiMTpvj9GUGaKRtoRGx-result\"}}, :nextjournal/blob-id \"5dsnHoXv3sNr7wTXDetQTPAVi2snzm\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5drBddrWRPHHiMTpvj9GUGaKRtoRGx-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5drYg7oKqFyocJdRg1tyTJkaAPdP1U\"} [\"h3\" {:id \"quadratic\"} [:<> \"Quadratic\"]] [:p [:<> \"This is a special case which analytically find roots of any quadratic equations with given coefficients\"]] [#viewer-eval nextjournal.clerk.render/inspect-presented {:nextjournal/value \"q(x) = ax^2+bx+c\", :nextjournal/viewer {:name :nextjournal.markdown/block-formula, :render-fn #viewer-fn nextjournal.clerk.render/render-katex, :hash \"5dtLYB93Mi3NowoYurf1Ue76yrXtDC\"}}] [:p [:<> \"Returns a pair of doubles or \"] [:code [:<> \"nil\"]] [:<> \" when no solution is found\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5drYg7oKqFyocJdRg1tyTJkaAPdP1U\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [{:path [0], :nextjournal/value {:val {:path [0 :val], :nextjournal/value [{:path [0 :val 0], :nextjournal/value -0.31622776601683794, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [0 :val 1], :nextjournal/value 0.31622776601683794, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/vector-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-coll, :opening-paren \"[\", :closing-paren \"]\", :page-size 20, :hash \"5dsD1KJESfc8Dy8gPeGQfZCX2ayE8f\"}}, :form {:path [0 :form], :nextjournal/value \"(solver/quadratic 1 0 -0.1)\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}}, :nextjournal/viewer {:render-fn #viewer-fn (fn [{:keys [form val]} opts] [:div.flex.flex-wrap {:class \"py-[7px]\"} [:div [:div.bg-slate-100.px-2.rounded (nextjournal.clerk.render/inspect-presented opts form)]] [:div.flex.mt-1 [:div.mx-2.font-sans.text-xs.text-slate-500 {:class \"mt-[2px]\"} \"⇒\"] (nextjournal.clerk.render/inspect-presented opts val)]]), :hash \"5ds743FyQWkf2b4b8Z3eu6VsyDmzu1\"}} {:path [1], :nextjournal/value {:val {:path [1 :val], :nextjournal/value [{:path [1 :val 0], :nextjournal/value 1.0, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}} {:path [1 :val 1], :nextjournal/value 1.0, :nextjournal/viewer {:name nextjournal.clerk.viewer/number-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-number, :hash \"5dr3R1ZvHCoRHpxsQq4D4ARv9BQC7o\"}}], :nextjournal/viewer {:name nextjournal.clerk.viewer/vector-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-coll, :opening-paren \"[\", :closing-paren \"]\", :page-size 20, :hash \"5dsD1KJESfc8Dy8gPeGQfZCX2ayE8f\"}}, :form {:path [1 :form], :nextjournal/value \"(solver/quadratic 1 -2 1)\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}}, :nextjournal/viewer {:render-fn #viewer-fn (fn [{:keys [form val]} opts] [:div.flex.flex-wrap {:class \"py-[7px]\"} [:div [:div.bg-slate-100.px-2.rounded (nextjournal.clerk.render/inspect-presented opts form)]] [:div.flex.mt-1 [:div.mx-2.font-sans.text-xs.text-slate-500 {:class \"mt-[2px]\"} \"⇒\"] (nextjournal.clerk.render/inspect-presented opts val)]]), :hash \"5ds743FyQWkf2b4b8Z3eu6VsyDmzu1\"}} {:path [2], :nextjournal/value {:val {:path [2 :val], :nextjournal/value nil, :nextjournal/viewer {:name nextjournal.clerk.viewer/nil-viewer, :render-fn #viewer-fn (fn [_] [:span.cmt-default.inspected-value \"nil\"]), :hash \"5ds3x8WPypHpZ82nScxBB4onExS7LG\"}}, :form {:path [2 :form], :nextjournal/value \"(solver/quadratic 1 1 1)\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}}, :nextjournal/viewer {:render-fn #viewer-fn (fn [{:keys [form val]} opts] [:div.flex.flex-wrap {:class \"py-[7px]\"} [:div [:div.bg-slate-100.px-2.rounded (nextjournal.clerk.render/inspect-presented opts form)]] [:div.flex.mt-1 [:div.mx-2.font-sans.text-xs.text-slate-500 {:class \"mt-[2px]\"} \"⇒\"] (nextjournal.clerk.render/inspect-presented opts val)]]), :hash \"5ds743FyQWkf2b4b8Z3eu6VsyDmzu1\"}}], :nextjournal/viewer {:render-fn #viewer-fn (fn [examples opts] (into [:div.border-l-2.border-slate-300.pl-4 [:div.uppercase.tracking-wider.text-xs.font-sans.text-slate-500.mt-4.mb-2 \"Examples\"]] (nextjournal.clerk.render/inspect-children opts) examples)), :hash \"5drXYjpMtPM3wu3HfEhFmWaJ1By2Fx\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dsxN6Bjsiv9Y3KVDwmxo6PyHDmkgH-result\"}}, :nextjournal/blob-id \"5dtKzAgChPRxxQdimPycPZtx6Xhb7J\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dsxN6Bjsiv9Y3KVDwmxo6PyHDmkgH-result\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id \"calculus/markdown-5ds51DdVe27kN5AgBgUpzLBkZgFzqX\"} [\"h1\" {:id \"list-of-symbols\"} [:<> \"List of symbols\"]]], :nextjournal/render-opts {:id \"calculus/markdown-5ds51DdVe27kN5AgBgUpzLBkZgFzqX\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [:div [:div [:span [:b {:class \"underline decoration-2 decoration-gray-400\"} \"fastmath.calculus\"] \" namespace\"] [:p] [:div [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [0], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id nil} [:p [:<> \"Integration and derivatives\"]] [:p [:<> \"Integrate univariate and multivariate functions.\"]] [:ul [:li [:<> [:<> \"VEGAS / VEGAS+ - Monte Carlo integration of multivariate function\"]]] [:li [:<> [:<> \"h-Cubature - h-adaptive integration of multivariate function\"]]] [:li [:<> [:<> \"Guass-Kronrod and Gauss-Legendre - quadrature integration of univariate functions\"]]] [:li [:<> [:<> \"Romberg, Simpson, MidPoint and Trapezoid\"]]]] [:p [:<> \"Integrant is substituted in case of improper integration bounds.\"]] [:p [:<> \"Derivatives (finite differences method):\"]] [:ul [:li [:<> [:<> \"derivatives of any degree and any order of accuracy\"]]] [:li [:<> [:<> \"gradient and hessian for multivariate functions\"]]]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}}]]] [:div ([:div {:class \"pb-8\", :id \"LOS-cubature\"} [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [1], :nextjournal/value [:span [:b {:class \"underline decoration-2 decoration-gray-400\"} cubature] nil nil [:sup [:a {:href \"https://github.com/generateme/fastmath/blob/master/src/fastmath/calculus.clj#L614\"} \"  [source]\"]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}] nil [:p] nil [:div [:div ([#viewer-eval nextjournal.clerk.render/inspect-presented {:path [2], :nextjournal/value \"(cubature f lower upper)\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}] [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [3], :nextjournal/value \"(cubature\\n f\\n lower\\n upper\\n {:keys [rel abs max-evals max-iters initdiv info?],\\n  :or\\n  {rel 1.0E-7,\\n   abs 1.0E-7,\\n   max-evals Integer/MAX_VALUE,\\n   max-iters 64,\\n   initdiv 2,\\n   info? false}})\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}])] [:p]] [:div [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [4], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id nil} [:p [:<> \"Cubature - h-adaptive integration of multivariate function, n>1 dimensions.\"]] [:p [:<> \"Algorithm uses Genz Malik method.\"]] [:p [:<> \"In each iteration a box with biggest error is subdivided and reevaluated.\"]] [:p [:<> \"Improper integrals with infinite bounds are handled by a substitution.\"]] [:p [:<> \"Arguments:\"]] [:ul [:li [:<> [:code [:<> \"f\"]] [:<> \" - integrant\"]]] [:li [:<> [:code [:<> \"lower\"]] [:<> \" - seq of lower bounds\"]]] [:li [:<> [:code [:<> \"upper\"]] [:<> \" - seq of upper bounds\"]]]] [:p [:<> \"Options:\"]] [:ul [:li [:<> [:code [:<> \":initvid\"]] [:<> \" - initial subdivision per dimension, default: 2.\"]]] [:li [:<> [:code [:<> \":max-evals\"]] [:<> \" - maximum number of evaluations, default: max integer value.\"]]] [:li [:<> [:code [:<> \":max-iters\"]] [:<> \" - maximum number of iterations, default: 64.\"]]] [:li [:<> [:code [:<> \":rel\"]] [:<> \" - relative error, 1.0e-7\"]]] [:li [:<> [:code [:<> \":abs\"]] [:<> \" - absolute error, 1.0e-7\"]]] [:li [:<> [:code [:<> \":info?\"]] [:<> \" - return full information about integration, default: false\"]]]] [:p [:<> \"Function returns a map containing (if info? is true, returns result otherwise):\"]] [:ul [:li [:<> [:code [:<> \":result\"]] [:<> \" - integration value\"]]] [:li [:<> [:code [:<> \":error\"]] [:<> \" - integration error\"]]] [:li [:<> [:code [:<> \":iterations\"]] [:<> \" - number of iterations\"]]] [:li [:<> [:code [:<> \":evaluations\"]] [:<> \" - number of evaluations\"]]] [:li [:<> [:code [:<> \":subdivisions\"]] [:<> \" - final number of boxes\"]]] [:li [:<> [:code [:<> \":fail?\"]] [:<> \" - set to \"] [:code [:<> \":max-evals\"]] [:<> \" or \"] [:code [:<> \":max-iters\"]] [:<> \" when one of the limits has been reached without the convergence.\"]]]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}}]]] [:div {:class \"pb-8\", :id \"LOS-derivative\"} [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [5], :nextjournal/value [:span [:b {:class \"underline decoration-2 decoration-gray-400\"} derivative] nil nil [:sup [:a {:href \"https://github.com/generateme/fastmath/blob/master/src/fastmath/calculus.clj#L1179\"} \"  [source]\"]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}] nil [:p] nil [:div [:div ([#viewer-eval nextjournal.clerk.render/inspect-presented {:path [6], :nextjournal/value \"(derivative f)\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}] [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [7], :nextjournal/value \"(derivative f n)\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}] [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [8], :nextjournal/value \"(derivative\\n f\\n n\\n {:keys [acc h method extrapolate?],\\n  :or {acc 2, h 0.0, method :central}})\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}])] [:p]] [:div [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [9], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id nil} [:p [:<> \"Create nth derivative of \"] [:code [:<> \"f\"]] [:<> \" using finite difference method for given accuracy \"] [:code [:<> \":acc\"]] [:<> \" and step \"] [:code [:<> \":h\"]] [:<> \".\"]] [:p [:<> \"Returns function.\"]] [:p [:<> \"Arguments:\"]] [:ul [:li [:<> [:code [:<> \"n\"]] [:<> \" - derivative\"]]] [:li [:<> [:code [:<> \":acc\"]] [:<> \" - order of accuracy (default: 2)\"]]] [:li [:<> [:code [:<> \":h\"]] [:<> \" - step, (default: 0.0, automatic)\"]]] [:li [:<> [:code [:<> \":method\"]] [:<> \" - \"] [:code [:<> \":central\"]] [:<> \" (default), \"] [:code [:<> \":forward\"]] [:<> \" or \"] [:code [:<> \":backward\"]]]] [:li [:<> [:code [:<> \":extrapolate?\"]] [:<> \" - creates extrapolated derivative if set to true or a map with \"] [:a {:href \"#LOS-extrapolate\"} [:<> \"extrapolate\"]] [:<> \" function options\"]]]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}}]]] [:div {:class \"pb-8\", :id \"LOS-extrapolate\"} [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [10], :nextjournal/value [:span [:b {:class \"underline decoration-2 decoration-gray-400\"} extrapolate] nil nil [:sup [:a {:href \"https://github.com/generateme/fastmath/blob/master/src/fastmath/calculus.clj#L1041\"} \"  [source]\"]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}] nil [:p] nil [:div [:div ([#viewer-eval nextjournal.clerk.render/inspect-presented {:path [11], :nextjournal/value \"(extrapolate g)\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}] [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [12], :nextjournal/value \"(extrapolate\\n g\\n {:keys [contract power init-h rel abs max-evals tol],\\n  :or\\n  {contract 0.5,\\n   power 1.0,\\n   init-h 0.5,\\n   abs m/MACHINE-EPSILON,\\n   rel (m/sqrt (m/ulp init-h)),\\n   max-evals Integer/MAX_VALUE,\\n   tol 2.0}})\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}])] [:p]] [:div [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [13], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id nil} [:p [:<> \"Richardson extrapolation for given function \"] [:code [:<> \"g=g(x,h)\"]] [:<> \". Returns extrapolated function f(x).\"]] [:p [:<> \"Options:\"]] [:ul [:li [:<> [:code [:<> \":contract\"]] [:<> \" - shrinkage factor, default=\"] [:code [:<> \"1/2\"]]]] [:li [:<> [:code [:<> \":power\"]] [:<> \" - set to \"] [:code [:<> \"2.0\"]] [:<> \" for even functions around \"] [:code [:<> \"x0\"]] [:<> \", default \"] [:code [:<> \"1.0\"]]]] [:li [:<> [:code [:<> \":init-h\"]] [:<> \" - initial step \"] [:code [:<> \"h\"]] [:<> \", default=\"] [:code [:<> \"1/2\"]]]] [:li [:<> [:code [:<> \":abs\"]] [:<> \" - absolute error, default: machine epsilon\"]]] [:li [:<> [:code [:<> \":rel\"]] [:<> \" - relative error, default: ulp for init-h\"]]] [:li [:<> [:code [:<> \":tol\"]] [:<> \" - tolerance for error, default: \"] [:code [:<> \"2.0\"]]]] [:li [:<> [:code [:<> \":max-evals\"]] [:<> \" - maximum evaluations, default: maximum integer\"]]]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}}]]] [:div {:class \"pb-8\", :id \"LOS-f'\"} [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [14], :nextjournal/value [:span [:b {:class \"underline decoration-2 decoration-gray-400\"} f'] nil nil [:sup [:a {:href \"https://github.com/generateme/fastmath/blob/master/src/fastmath/calculus.clj#L1220\"} \"  [source]\"]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}] nil [:p] nil [:div [:div ([#viewer-eval nextjournal.clerk.render/inspect-presented {:path [15], :nextjournal/value \"(f' f)\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}])] [:p]] [:div [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [16], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id nil} [:p [:<> \"First central derivative with order of accuracy 2.\"]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}}]]] [:div {:class \"pb-8\", :id \"LOS-f''\"} [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [17], :nextjournal/value [:span [:b {:class \"underline decoration-2 decoration-gray-400\"} f''] nil nil [:sup [:a {:href \"https://github.com/generateme/fastmath/blob/master/src/fastmath/calculus.clj#L1221\"} \"  [source]\"]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}] nil [:p] nil [:div [:div ([#viewer-eval nextjournal.clerk.render/inspect-presented {:path [18], :nextjournal/value \"(f'' f)\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}])] [:p]] [:div [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [19], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id nil} [:p [:<> \"Second central derivative with order of accuracy 2.\"]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}}]]] [:div {:class \"pb-8\", :id \"LOS-f'''\"} [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [20], :nextjournal/value [:span [:b {:class \"underline decoration-2 decoration-gray-400\"} f'''] nil nil [:sup [:a {:href \"https://github.com/generateme/fastmath/blob/master/src/fastmath/calculus.clj#L1222\"} \"  [source]\"]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}] nil [:p] nil [:div [:div ([#viewer-eval nextjournal.clerk.render/inspect-presented {:path [21], :nextjournal/value \"(f''' f)\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}])] [:p]] [:div [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [22], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id nil} [:p [:<> \"Third central derivative with order of accuracy 2.\"]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}}]]] [:div {:class \"pb-8\", :id \"LOS-fx->gx+h\"} [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [23], :nextjournal/value [:span [:b {:class \"underline decoration-2 decoration-gray-400\"} fx->gx+h] nil nil [:sup [:a {:href \"https://github.com/generateme/fastmath/blob/master/src/fastmath/calculus.clj#L1028\"} \"  [source]\"]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}] nil [:p] nil [:div [:div ([#viewer-eval nextjournal.clerk.render/inspect-presented {:path [24], :nextjournal/value \"(fx->gx+h f)\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}])] [:p]] [:div [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [25], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id nil} [:p [:<> \"Convert f(x) to g(x,h)=f(x+h)\"]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}}]]] [:div {:class \"pb-8\", :id \"LOS-fx->gx-h\"} [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [26], :nextjournal/value [:span [:b {:class \"underline decoration-2 decoration-gray-400\"} fx->gx-h] nil nil [:sup [:a {:href \"https://github.com/generateme/fastmath/blob/master/src/fastmath/calculus.clj#L1034\"} \"  [source]\"]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}] nil [:p] nil [:div [:div ([#viewer-eval nextjournal.clerk.render/inspect-presented {:path [27], :nextjournal/value \"(fx->gx-h f)\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}])] [:p]] [:div [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [28], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id nil} [:p [:<> \"Convert f(x) to g(x,h)=f(x-h)\"]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}}]]] [:div {:class \"pb-8\", :id \"LOS-gradient\"} [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [29], :nextjournal/value [:span [:b {:class \"underline decoration-2 decoration-gray-400\"} gradient] nil nil [:sup [:a {:href \"https://github.com/generateme/fastmath/blob/master/src/fastmath/calculus.clj#L1224\"} \"  [source]\"]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}] nil [:p] nil [:div [:div ([#viewer-eval nextjournal.clerk.render/inspect-presented {:path [30], :nextjournal/value \"(gradient f)\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}] [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [31], :nextjournal/value \"(gradient f {:keys [h acc], :or {h 1.0E-6, acc 2}})\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}])] [:p]] [:div [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [32], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id nil} [:p [:<> \"Create first partial derivatives of multivariate function for given accuracy \"] [:code [:<> \":acc\"]] [:<> \" and step \"] [:code [:<> \":h\"]] [:<> \".\"]] [:p [:<> \"Returns function.\"]] [:p [:<> \"Options:\"]] [:ul [:li [:<> [:code [:<> \":acc\"]] [:<> \" - order of accuracy, 2 (default) or 4.\"]]] [:li [:<> [:code [:<> \":h\"]] [:<> \" - step, default \"] [:code [:<> \"1.0e-6\"]]]]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}}]]] [:div {:class \"pb-8\", :id \"LOS-hessian\"} [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [33], :nextjournal/value [:span [:b {:class \"underline decoration-2 decoration-gray-400\"} hessian] nil nil [:sup [:a {:href \"https://github.com/generateme/fastmath/blob/master/src/fastmath/calculus.clj#L1263\"} \"  [source]\"]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}] nil [:p] nil [:div [:div ([#viewer-eval nextjournal.clerk.render/inspect-presented {:path [34], :nextjournal/value \"(hessian f)\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}] [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [35], :nextjournal/value \"(hessian f {:keys [h], :or {h 0.005}})\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}])] [:p]] [:div [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [36], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id nil} [:p [:<> \"Creates function returning Hessian matrix for mulitvariate function \"] [:code [:<> \"f\"]] [:<> \" and given \"] [:code [:<> \":h\"]] [:<> \" step (default: \"] [:code [:<> \"5.0e-3\"]] [:<> \").\"]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}}]]] [:div {:class \"pb-8\", :id \"LOS-integrate\"} [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [37], :nextjournal/value [:span [:b {:class \"underline decoration-2 decoration-gray-400\"} integrate] nil nil [:sup [:a {:href \"https://github.com/generateme/fastmath/blob/master/src/fastmath/calculus.clj#L940\"} \"  [source]\"]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}] nil [:p] nil [:div [:div ([#viewer-eval nextjournal.clerk.render/inspect-presented {:path [38], :nextjournal/value \"(integrate f)\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}] [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [39], :nextjournal/value \"(integrate f lower upper)\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}] [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [40], :nextjournal/value \"(integrate\\n f\\n lower\\n upper\\n {:keys\\n  [rel\\n   abs\\n   max-iters\\n   min-iters\\n   max-evals\\n   info?\\n   integrator\\n   integration-points],\\n  :or\\n  {rel BaseAbstractUnivariateIntegrator/DEFAULT_RELATIVE_ACCURACY,\\n   abs BaseAbstractUnivariateIntegrator/DEFAULT_ABSOLUTE_ACCURACY,\\n   min-iters\\n   BaseAbstractUnivariateIntegrator/DEFAULT_MIN_ITERATIONS_COUNT,\\n   max-evals Integer/MAX_VALUE,\\n   integration-points 7,\\n   integrator :gauss-kronrod,\\n   info? false},\\n  :as options})\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}])] [:p]] [:div [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [41], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id nil} [:p [:<> \"Univariate integration.\"]] [:p [:<> \"Improper integrals with infinite bounds are handled by a substitution.\"]] [:p [:<> \"Arguments:\"]] [:ul [:li [:<> [:code [:<> \"f\"]] [:<> \" - integrant\"]]] [:li [:<> [:code [:<> \"lower\"]] [:<> \" - lower bound\"]]] [:li [:<> [:code [:<> \"upper\"]] [:<> \" - upper bound\"]]]] [:p [:<> \"Options:\"]] [:ul [:li [:<> [:code [:<> \":integrator\"]] [:<> \" - integration algorithm, one of: \"] [:code [:<> \":romberg\"]] [:<> \", \"] [:code [:<> \":trapezoid\"]] [:<> \", \"] [:code [:<> \":midpoint\"]] [:<> \", \"] [:code [:<> \":simpson\"]] [:<> \", \"] [:code [:<> \":gauss-legendre\"]] [:<> \" and \"] [:code [:<> \":gauss-kronrod\"]] [:<> \" (default).\"]]] [:li [:<> [:code [:<> \":min-iters\"]] [:<> \" - minimum number of iterations (default: 3), not used in \"] [:code [:<> \":gauss-kronrod\"]]]] [:li [:<> [:code [:<> \":max-iters\"]] [:<> \" - maximum number of iterations (default: 32 or 64)\"]]] [:li [:<> [:code [:<> \":max-evals\"]] [:<> \" - maximum number of evaluations, (default: maximum integer)\"]]] [:li [:<> [:code [:<> \":rel\"]] [:<> \" - relative error\"]]] [:li [:<> [:code [:<> \":abs\"]] [:<> \" - absolute error\"]]] [:li [:<> [:code [:<> \":integration-points\"]] [:<> \" - number of integration (quadrature) points for \"] [:code [:<> \":gauss-legendre\"]] [:<> \" and \"] [:code [:<> \":gauss-kronrod\"]] [:<> \", default 7\"]]] [:li [:<> [:code [:<> \":initdiv\"]] [:<> \" - initial number of subdivisions for \"] [:code [:<> \":gauss-kronrod\"]] [:<> \", default: 1\"]]] [:li [:<> [:code [:<> \":info?\"]] [:<> \" - return full information about integration, default: false\"]]]] [:p [:code [:<> \":gauss-kronrod\"]] [:<> \" is h-adaptive implementation\"]] [:p [:<> \"Function returns a map containing (if info? is true, returns result otherwise):\"]] [:ul [:li [:<> [:code [:<> \":result\"]] [:<> \" - integration value\"]]] [:li [:<> [:code [:<> \":error\"]] [:<> \" - integration error (\"] [:code [:<> \":gauss-kronrod\"]] [:<> \" only)\"]]] [:li [:<> [:code [:<> \":iterations\"]] [:<> \" - number of iterations\"]]] [:li [:<> [:code [:<> \":evaluations\"]] [:<> \" - number of evaluations\"]]] [:li [:<> [:code [:<> \":subdivisions\"]] [:<> \" - final number of boxes (\"] [:code [:<> \":gauss-kronrod\"]] [:<> \" only)\"]]] [:li [:<> [:code [:<> \":fail?\"]] [:<> \" - set to \"] [:code [:<> \":max-evals\"]] [:<> \" or \"] [:code [:<> \":max-iters\"]] [:<> \" when one of the limits has been reached without the convergence.\"]]]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}}]]] [:div {:class \"pb-8\", :id \"LOS-vegas\"} [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [42], :nextjournal/value [:span [:b {:class \"underline decoration-2 decoration-gray-400\"} vegas] nil nil [:sup [:a {:href \"https://github.com/generateme/fastmath/blob/master/src/fastmath/calculus.clj#L320\"} \"  [source]\"]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}] nil [:p] nil [:div [:div ([#viewer-eval nextjournal.clerk.render/inspect-presented {:path [43], :nextjournal/value \"(vegas f lower upper)\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}] [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [44], :nextjournal/value \"(vegas\\n f\\n lower\\n upper\\n {:keys\\n  [max-iters rel abs nevals alpha beta warmup info? record-data?],\\n  :or\\n  {max-iters 10,\\n   rel 5.0E-4,\\n   abs 5.0E-4,\\n   nevals 10000,\\n   beta 0.75,\\n   warmup 0,\\n   info? false,\\n   record-data? false},\\n  :as options})\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}])] [:p]] [:div [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [45], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id nil} [:p [:<> \"VEGAS+ - Monte Carlo integration of multivariate function, n>1 dimensions.\"]] [:p [:<> \"Improper integrals with infinite bounds are handled by a substitution.\"]] [:p [:<> \"Arguments:\"]] [:ul [:li [:<> [:code [:<> \"f\"]] [:<> \" - integrant\"]]] [:li [:<> [:code [:<> \"lower\"]] [:<> \" - seq of lower bounds\"]]] [:li [:<> [:code [:<> \"upper\"]] [:<> \" - seq of upper bounds\"]]]] [:p [:<> \"Additional options:\"]] [:ul [:li [:<> [:code [:<> \":max-iters\"]] [:<> \" - maximum number of iterations, default: 10\"]]] [:li [:<> [:code [:<> \":nevals\"]] [:<> \" - number of evaluations per iteration, default: 10000\"]]] [:li [:<> [:code [:<> \":nintervals\"]] [:<> \" - number of grid intervals per dimension (default: 1000)\"]]] [:li [:<> [:code [:<> \":nstrats\"]] [:<> \" - number of stratifications per dimension (calculated)\"]]] [:li [:<> [:code [:<> \":warmup\"]] [:<> \" - number of warmup iterations (results are used to train stratification and grid spacings, default: 0\"]]] [:li [:<> [:code [:<> \":alpha\"]] [:<> \" - grid refinement parameter, 0.5 slow (default for vegas+), 1.5 moderate/fast (defatult for vegas)\"]]] [:li [:<> [:code [:<> \":beta\"]] [:<> \" - stratification damping parameter for startification adaptation, default: 0.75\"]]] [:li [:<> [:code [:<> \":rel\"]] [:<> \" - relative accuracy, default: 5.0e-4\"]]] [:li [:<> [:code [:<> \":abs\"]] [:<> \" - absolute accuracy, default: 5.0e-4\"]]] [:li [:<> [:code [:<> \":random-sequence\"]] [:<> \" - random sequence used for generating samples: \"] [:code [:<> \":uniform\"]] [:<> \" (default), low-discrepancy sequences: \"] [:code [:<> \":r2\"]] [:<> \", \"] [:code [:<> \":sobol\"]] [:<> \" and \"] [:code [:<> \":halton\"]] [:<> \".\"]]] [:li [:<> [:code [:<> \":jitter\"]] [:<> \" - jittering factor for low-discrepancy random sequence, default: 0.75\"]]] [:li [:<> [:code [:<> \":info?\"]] [:<> \" - return full information about integration, default: false\"]]] [:li [:<> [:code [:<> \":record-data?\"]] [:<> \" - stores samples, number of strata, x and dx, default: false (requires, \"] [:code [:<> \":info?\"]] [:<> \" to be set to \"] [:code [:<> \"true\"]] [:<> \")\"]]]] [:p [:<> \"For original VEGAS algorithm set \"] [:code [:<> \":nstrats\"]] [:<> \" to \"] [:code [:<> \"1\"]] [:<> \".\"]] [:p [:code [:<> \":nstrats\"]] [:<> \" can be also a list, then each dimension is divided independently according to a given number. If list is lower then number of dimensions, then it's cycled.\"]] [:p [:<> \"Function returns a map with following keys (if info? is true, returns result otherwise):\"]] [:ul [:li [:<> [:code [:<> \":result\"]] [:<> \" - value of integral\"]]] [:li [:<> [:code [:<> \":iterations\"]] [:<> \" - number of iterations (excluding warmup)\"]]] [:li [:<> [:code [:<> \":sd\"]] [:<> \" - standard deviation of results\"]]] [:li [:<> [:code [:<> \":nintervals\"]] [:<> \" - actual grid size\"]]] [:li [:<> [:code [:<> \":nstrats\"]] [:<> \" - number of stratitfications per dimension\"]]] [:li [:<> [:code [:<> \":nhcubes\"]] [:<> \" - number of hypercubes\"]]] [:li [:<> [:code [:<> \":evaluations\"]] [:<> \" - number of function calls\"]]] [:li [:<> [:code [:<> \":chi2-avg\"]] [:<> \" - average of chi2\"]]] [:li [:<> [:code [:<> \":dof\"]] [:<> \" - degrees of freedom\"]]] [:li [:<> [:code [:<> \":Q\"]] [:<> \" - goodness of fit indicator, 1 - very good, <0.25 very poor\"]]] [:li [:<> [:code [:<> \":data\"]] [:<> \" - recorded data (if available)\"]]]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}}]]])]], :nextjournal/visibility {:code :hide, :result :show}, :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dr72HUtZupsjWWeKFBanWBYT74iNL-result\"}}, :nextjournal/blob-id \"5dtDxP9nZkfcrYBQ3BMDWYhBVe6WGh\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dr72HUtZupsjWWeKFBanWBYT74iNL-result\"}, :nextjournal/visibility {:code :hide, :result :show}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}} {:path [], :nextjournal/value {:nextjournal/presented {:path [], :nextjournal/value [:div [:div [:span [:b {:class \"underline decoration-2 decoration-gray-400\"} \"fastmath.solver\"] \" namespace\"] [:p] [:div [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [0], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id nil}], :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}}]]] [:div ([:div {:class \"pb-8\", :id \"LOS-find-root\"} [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [1], :nextjournal/value [:span [:b {:class \"underline decoration-2 decoration-gray-400\"} find-root] nil nil [:sup [:a {:href \"https://github.com/generateme/fastmath/blob/master/src/fastmath/solver.clj#L31\"} \"  [source]\"]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}] nil [:p] nil [:div [:div ([#viewer-eval nextjournal.clerk.render/inspect-presented {:path [2], :nextjournal/value \"(find-root f lower-bound upper-bound)\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}] [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [3], :nextjournal/value \"(find-root\\n f\\n lower-bound\\n upper-bound\\n {:keys\\n  [absolute-accuracy relative-accuracy max-iters initial-value solver],\\n  :or {max-iters 100, solver :brent}})\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}])] [:p]] [:div [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [4], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id nil} [:p [:<> \"Find zero (root) of a function \"] [:code [:<> \"f\"]] [:<> \" in given range [\"] [:code [:<> \"lower-bound\"]] [:<> \", \"] [:code [:<> \"upper-bound\"]] [:<> \"].\"]] [:p [:<> \"Optional parameters:\"]] [:ul [:li [:<> [:code [:<> \":absolute-accuracy\"]] [:<> \" - default 1.0e-8\"]]] [:li [:<> [:code [:<> \":relative-accuracy\"]]]] [:li [:<> [:code [:<> \":max-iters\"]] [:<> \" - maximum iterations (default: 100)\"]]] [:li [:<> [:code [:<> \":initial-value\"]] [:<> \" - algorithm starting value\"]]] [:li [:<> [:code [:<> \":solver\"]] [:<> \" - one of: \"] [:code [:<> \":brent\"]] [:<> \" (default), \"] [:code [:<> \":bisection\"]] [:<> \", \"] [:code [:<> \":illinois\"]] [:<> \", \"] [:code [:<> \":muller\"]] [:<> \", \"] [:code [:<> \":muller2\"]] [:<> \", \"] [:code [:<> \":pegasus\"]] [:<> \", \"] [:code [:<> \":regula-falsi\"]] [:<> \", \"] [:code [:<> \":ridders\"]] [:<> \" and \"] [:code [:<> \":secant\"]] [:<> \".\"]]]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}}]]] [:div {:class \"pb-8\", :id \"LOS-quadratic\"} [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [5], :nextjournal/value [:span [:b {:class \"underline decoration-2 decoration-gray-400\"} quadratic] nil nil [:sup [:a {:href \"https://github.com/generateme/fastmath/blob/master/src/fastmath/solver.clj#L50\"} \"  [source]\"]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}}] nil [:p] nil [:div [:div ([#viewer-eval nextjournal.clerk.render/inspect-presented {:path [6], :nextjournal/value \"(quadratic a b c)\", :nextjournal/render-opts {:language \"clojure\"}, :nextjournal/viewer {:name nextjournal.clerk.viewer/code-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-code, :hash \"5dsJQw12yyyd7TcZEf52VSHxnqnJUC\"}}])] [:p]] [:div [#viewer-eval nextjournal.clerk.render/inspect-presented {:path [7], :nextjournal/value [:div.viewer.markdown-viewer.w-full.max-w-prose.px-8 {:data-block-id nil} [:p [:<> \"Solution of quadratic formula ax^2+bx+c=0, returns \"] [:code [:<> \"nil\"]] [:<> \" when there are no solutions\"]]], :nextjournal/viewer {:name nextjournal.clerk.viewer/markdown-node-viewer, :render-fn #viewer-fn identity, :hash \"5dsg4Bx9A9L7WvvCgamUoRtxUsmYCe\"}}]]])]], :nextjournal/visibility {:code :hide, :result :show}, :nextjournal/viewer {:name nextjournal.clerk.viewer/html-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-html, :hash \"5drpr3yzJ1CcHNbRHnK2sVyn7YUmXB\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dtPmnA3VyMnvbHype5AHe14eFJ4iP-result\"}}, :nextjournal/blob-id \"5dre9yz94PLs6MteYLDPXBSLNuhoyH\"}, :nextjournal/render-opts {:id \"calculus/anon-expr-5dtPmnA3VyMnvbHype5AHe14eFJ4iP-result\"}, :nextjournal/visibility {:code :hide, :result :show}, :nextjournal/viewer {:name nextjournal.clerk.viewer/result-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-result, :hash \"5dtGVHesd2XCTLFYF3aY4kJvkrX1x1\"}}]}, :nextjournal/viewer {:name nextjournal.clerk.viewer/notebook-viewer, :render-fn #viewer-fn nextjournal.clerk.render/render-notebook, :hash \"5duAFDxE4sCnRX71Wo6zeCpC9C3djE\"}}}, :current-path \"notebooks/calculus\", :resource->url {\"/js/viewer.js\" \"https://storage.clerk.garden/nextjournal/clerk-assets@3mwzShgnuyfhgFN9ahRYKqV32K11/viewer.js?immutable=true\"}, :index #object[java.net.URL 0x263bc901 \"jar:file:/home/tsl/.m2/repository/io/github/nextjournal/clerk/0.15.957/clerk-0.15.957.jar!/nextjournal/clerk/index.clj\"]}".replaceAll('nextjournal.clerk.view/escape-closing-script-tag', 'script')
viewer.init(viewer.read_string(state))
</script></body></html>